Skip to content

Commit

Permalink
Pull request project-chip#907: [Silabs][Wf200] Disabling sleep
Browse files Browse the repository at this point in the history
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 <chirag.bansal@silabs.com>
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 (project-chip#26845)
  • Loading branch information
chirag-silabs authored and jmartinez-silabs committed Jun 22, 2023
1 parent dfda987 commit 0fc3464
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions examples/platform/silabs/efr32/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions examples/platform/silabs/efr32/wf200/host_if.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,15 +602,15 @@ 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
SILABS_LOG("WF200 going to DTIM based sleep");
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)
Expand Down

0 comments on commit 0fc3464

Please sign in to comment.