Skip to content

Commit

Permalink
Adds fix for MATTER-1907
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed Jun 21, 2023
1 parent 3326a40 commit ae9f3af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
8 changes: 2 additions & 6 deletions examples/platform/silabs/efr32/rs911x/hal/efx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,9 @@ sl_status_t sl_wfx_host_spi_cs_assert(void)
{
xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY);

if (!spi_enabled) // Reduce SPIDRV_Init
if (!spi_enabled) // Reduce sl_spidrv_init_instances
{
if (ECODE_OK != SPIDRV_Init(SL_SPIDRV_HANDLE, &sl_spidrv_eusart_init_exp))
{
xSemaphoreGive(spi_sem_sync_hdl);
return SL_STATUS_FAIL;
}
sl_spidrv_init_instances();
spi_enabled = true;
}
GPIO_PinOutClear(SL_SPIDRV_EUSART_EXP_CS_PORT, SL_SPIDRV_EUSART_EXP_CS_PIN);
Expand Down
8 changes: 3 additions & 5 deletions examples/platform/silabs/efr32/spi_multiplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern "C" {
#include "semphr.h"
#include "sl_memlcd_display.h"
#include "sl_mx25_flash_shutdown_usart_config.h"
#include "sl_spidrv_instances.h"
#include "spidrv.h"

#define SL_SPIDRV_LCD_BITRATE SL_MEMLCD_SCLK_FREQ
Expand All @@ -37,10 +38,8 @@ extern "C" {
#define SL_SPIDRV_EXP_BITRATE_MULTIPLEXED SL_SPIDRV_EUSART_EXP_BITRATE
#define SL_SPIDRV_UART_CONSOLE_BITRATE SL_UARTDRV_EUSART_VCOM_BAUDRATE
#define SL_SPIDRV_FRAME_LENGTH SL_SPIDRV_EUSART_EXP_FRAME_LENGTH
extern SPIDRV_Handle_t sl_spidrv_eusart_exp_handle;
#define SL_SPIDRV_HANDLE sl_spidrv_eusart_exp_handle
// TODO: (MATTER-1907) Replace use of extern variable
extern SPIDRV_Init_t sl_spidrv_eusart_init_exp;

#elif WF200_WIFI
#include "sl_spidrv_exp_config.h"
#include "sl_wfx_host_api.h"
Expand All @@ -50,9 +49,8 @@ extern SPIDRV_Init_t sl_spidrv_eusart_init_exp;
#define SL_SPIDRV_EXP_BITRATE_MULTIPLEXED 10000000
#define SL_SPIDRV_UART_CONSOLE_BITRATE SL_UARTDRV_USART_VCOM_BAUDRATE
#define SL_SPIDRV_FRAME_LENGTH SL_SPIDRV_EXP_FRAME_LENGTH
extern SPIDRV_Handle_t sl_spidrv_exp_handle;
#define SL_SPIDRV_HANDLE sl_spidrv_exp_handle
#endif
#endif /* RS911X_WIFI || WF200_WIFI */

/****************************************************************************
* @fn void SPIDRV_SetBaudrate()
Expand Down

0 comments on commit ae9f3af

Please sign in to comment.