Skip to content

Commit

Permalink
resolved the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bhmanda-silabs committed Feb 22, 2024
1 parent da447c7 commit 439a5da
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 17 deletions.
9 changes: 3 additions & 6 deletions examples/platform/silabs/display/demo-ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,17 @@ sl_status_t updateDisplay(void)
#if SL_LCDCTRL_MUX
status = sl_wfx_host_pre_lcd_spi_transfer();
if(status != SL_STATUS_OK)
{
return status;
}
#endif // SL_LCDCTRL_MUX
status = DMD_updateDisplay();
if (status != DMD_OK)
return SL_STATUS_FAIL;
#if SL_LCDCTRL_MUX
status = sl_wfx_host_post_lcd_spi_transfer();
if(status != SL_STATUS_OK)
{
return status;
}
#endif // SL_LCDCTRL_MUX
if (status != DMD_OK)
return SL_STATUS_FAIL;

return SL_STATUS_OK;
}

Expand Down
3 changes: 1 addition & 2 deletions examples/platform/silabs/efr32/rs911x/hal/efx32_ncp_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ uint32_t sl_si91x_host_get_wake_indicator(void)

sl_status_t sl_si91x_host_init(sl_si91x_host_init_configuration * config)
{
sl_status_t status = SL_STATUS_OK;
#if SL_SPICTRL_MUX
status = sl_board_disable_display();
sl_status_t status = sl_board_disable_display();
if (SL_STATUS_OK != status)
{
SILABS_LOG("sl_board_disable_display failed with error: %x", status);
Expand Down
8 changes: 3 additions & 5 deletions examples/platform/silabs/efr32/rs911x/hal/efx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ sl_status_t sl_wfx_host_spi_cs_assert(void)

sl_status_t sl_wfx_host_spi_cs_deassert(void)
{
sl_status_t status = SL_STATUS_OK;
sl_status_t status = SL_STATUS_OK;
if (spi_enabled)
{
status = SPIDRV_DeInit(SL_SPIDRV_HANDLE);
Expand Down Expand Up @@ -295,11 +295,10 @@ sl_status_t sl_wfx_host_post_bootloader_spi_transfer(void)
#if SL_LCDCTRL_MUX
sl_status_t sl_wfx_host_pre_lcd_spi_transfer(void)
{
sl_status_t status = SL_STATUS_OK;
#if SL_SPICTRL_MUX
xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY);
#endif // SL_SPICTRL_MUX
status = sl_board_enable_display();
sl_status_t status = sl_board_enable_display();
if (SL_STATUS_OK == status)
{
// sl_memlcd_refresh takes care of SPIDRV_Init()
Expand All @@ -313,11 +312,10 @@ sl_status_t sl_wfx_host_pre_lcd_spi_transfer(void)

sl_status_t sl_wfx_host_post_lcd_spi_transfer(void)
{
sl_status_t status = SL_STATUS_OK;
USART_Enable(SL_MEMLCD_SPI_PERIPHERAL, usartDisable);
CMU_ClockEnable(SPI_CLOCK(SL_MEMLCD_SPI_PERIPHERAL_NO), false);
GPIO->USARTROUTE[SL_MEMLCD_SPI_PERIPHERAL_NO].ROUTEEN = PINOUT_CLEAR;
status = sl_board_disable_display();
sl_status_t status = sl_board_disable_display();
#if SL_SPICTRL_MUX
xSemaphoreGive(spi_sem_sync_hdl);
#endif // SL_SPICTRL_MUX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ SemaphoreHandle_t spi_sem_sync_hdl;
**********************************************************/
sl_status_t sl_wfx_host_pre_lcd_spi_transfer(void)
{
sl_status_t status = SL_STATUS_OK;
#if SL_SPICTRL_MUX
xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY);
#endif // SL_SPICTRL_MUX
status = sl_board_enable_display();
sl_status_t status = sl_board_enable_display();
if (SL_STATUS_OK == status)
{
SPIDRV_SetBaudrate(SL_SPIDRV_LCD_BITRATE);
Expand All @@ -104,8 +103,7 @@ sl_status_t sl_wfx_host_pre_lcd_spi_transfer(void)
**********************************************************/
sl_status_t sl_wfx_host_post_lcd_spi_transfer(void)
{
sl_status_t status = SL_STATUS_OK;
status = sl_board_disable_display();
sl_status_t status = sl_board_disable_display();
#if SL_SPICTRL_MUX
xSemaphoreGive(spi_sem_sync_hdl);
#endif // SL_SPICTRL_MUX
Expand Down

0 comments on commit 439a5da

Please sign in to comment.