Skip to content

Commit

Permalink
Adds missing ;
Browse files Browse the repository at this point in the history
  • Loading branch information
rosahay-silabs committed May 16, 2023
1 parent 3e26aed commit aba13c6
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions examples/platform/silabs/efr32/rs911x/hal/efx_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void sl_wfx_host_gpio_init(void)
NVIC_SetPriority(GPIO_EVEN_IRQn, WFX_SPI_NVIC_PRIORITY);
NVIC_SetPriority(GPIO_ODD_IRQn, WFX_SPI_NVIC_PRIORITY);
spi_enabled = true;
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

/*****************************************************************
Expand All @@ -141,7 +141,7 @@ void sl_wfx_host_reset_chip(void)

// Delay for 3ms
vTaskDelay(pdMS_TO_TICKS(3));
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

/*****************************************************************
Expand All @@ -166,23 +166,23 @@ void rsi_hal_board_init(void)

/* Reset of Wifi chip */
sl_wfx_host_reset_chip();
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

#if defined(EFR32MG24)
sl_status_t sl_wfx_host_spi_cs_assert()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
configASSERT(spi_sem_sync_hdl);
if (xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY) != pdTRUE)
{
SILABS_LOG("%s errored.", __func__)
SILABS_LOG("%s errored.", __func__);
return SL_STATUS_TIMEOUT;
}
// if (spi_enabled)
// {
// SPIDRV_DeInit(SL_SPIDRV_HANDLE);
// SILABS_LOG("%s did deinit.", __func__)
// SILABS_LOG("%s did deinit.", __func__);
// spi_enabled = false;
// }
if (!spi_enabled) // Reduce SPIDRV_Init
Expand All @@ -191,13 +191,13 @@ sl_status_t sl_wfx_host_spi_cs_assert()
spi_enabled = true;
}
GPIO_PinOutClear(SL_SPIDRV_EUSART_EXP_CS_PORT, SL_SPIDRV_EUSART_EXP_CS_PIN);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
return SL_STATUS_OK;
}

sl_status_t sl_wfx_host_spi_cs_deassert()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
if (spi_enabled)
{
SPIDRV_DeInit(SL_SPIDRV_HANDLE);
Expand All @@ -207,27 +207,27 @@ sl_status_t sl_wfx_host_spi_cs_deassert()
// TODO: should be done by deinit, check once.
GPIO->EUSARTROUTE[SL_SPIDRV_EUSART_EXP_PERIPHERAL_NO].ROUTEEN = 0;
xSemaphoreGive(spi_sem_sync_hdl);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
return SL_STATUS_OK;
}

void sl_wfx_host_spiflash_cs_assert()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
GPIO_PinOutClear(SL_MX25_FLASH_SHUTDOWN_CS_PORT, SL_MX25_FLASH_SHUTDOWN_CS_PIN);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_spiflash_cs_deassert()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
GPIO_PinOutSet(SL_MX25_FLASH_SHUTDOWN_CS_PORT, SL_MX25_FLASH_SHUTDOWN_CS_PIN);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_pre_bootloader_spi_transfer()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
if (xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY) != pdTRUE)
{
return;
Expand All @@ -240,22 +240,22 @@ void sl_wfx_host_pre_bootloader_spi_transfer()
bootloader_init();
// bootloader_init takes care of SPIDRV_Init()
sl_wfx_host_spiflash_cs_assert();
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_post_bootloader_spi_transfer()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
bootloader_deinit();
GPIO->USARTROUTE[0].ROUTEEN = 0;
sl_wfx_host_spiflash_cs_deassert();
xSemaphoreGive(spi_sem_sync_hdl);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_pre_lcd_spi_transfer()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
if (xSemaphoreTake(spi_sem_sync_hdl, portMAX_DELAY) != pdTRUE)
{
return;
Expand All @@ -267,17 +267,17 @@ void sl_wfx_host_pre_lcd_spi_transfer()
}
sl_memlcd_refresh(sl_memlcd_get());
// sl_memlcd_refresh takes care of SPIDRV_Init()
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

void sl_wfx_host_post_lcd_spi_transfer()
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
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 = 0;
xSemaphoreGive(spi_sem_sync_hdl);
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
}

#endif /* EFR32MG24 */
Expand Down Expand Up @@ -316,7 +316,7 @@ static void spi_dmaTransfertComplete(SPIDRV_HandleData_t * pxHandle, Ecode_t tra
**************************************************************************/
int16_t rsi_spi_transfer(uint8_t * tx_buf, uint8_t * rx_buf, uint16_t xlen, uint8_t mode)
{
SILABS_LOG("%s started.", __func__)
SILABS_LOG("%s started.", __func__);
#if defined(EFR32MG24)
sl_wfx_host_spi_cs_assert();
#endif /* EFR32MG24 */
Expand All @@ -325,7 +325,7 @@ int16_t rsi_spi_transfer(uint8_t * tx_buf, uint8_t * rx_buf, uint16_t xlen, uint
*/
if (xlen <= MIN_XLEN || (tx_buf == NULL && rx_buf == NULL))
{
SILABS_LOG("%s error.", __func__)
SILABS_LOG("%s error.", __func__);
return RSI_ERROR_INVALID_PARAM;
}

Expand Down Expand Up @@ -383,6 +383,6 @@ int16_t rsi_spi_transfer(uint8_t * tx_buf, uint8_t * rx_buf, uint16_t xlen, uint
#if defined(EFR32MG24)
sl_wfx_host_spi_cs_deassert();
#endif /* EFR32MG24 */
SILABS_LOG("%s completed.", __func__)
SILABS_LOG("%s completed.", __func__);
return rsiError;
}

0 comments on commit aba13c6

Please sign in to comment.