Skip to content

Commit b825bb3

Browse files
[Silabs] Brake the wifi implementations into platform specific source files (#36460)
* Split source between wifi platforms * Brake out wiseconnect specific code from the common abstraction * move power save function to specific interface * Remove hw state from extern C * Remove power save call form extern C * Remove unnecessary include * Restyle * Fix ifdef c++ include guards
1 parent d6b098b commit b825bb3

31 files changed

+803
-838
lines changed

examples/platform/silabs/BaseApplication.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
6565

6666
#ifdef SL_WIFI
67+
#include "WifiInterfaceAbstraction.h"
6768
#include "wfx_host_events.h"
6869
#include <app/clusters/network-commissioning/network-commissioning.h>
6970
#include <platform/silabs/NetworkCommissioningWiFiDriver.h>

examples/platform/silabs/MatterConfig.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
#if defined(SLI_SI91X_MCU_INTERFACE) && SLI_SI91X_MCU_INTERFACE == 1
4444
#include "SiWxPlatformInterface.h"
45-
#include "WifiInterfaceAbstraction.h"
45+
#include "WiseconnectInterfaceAbstraction.h"
4646
#endif // SLI_SI91X_MCU_INTERFACE
4747

4848
#include <crypto/CHIPCryptoPAL.h>

examples/platform/silabs/SiWx917/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ config("wifi-interface-config") {
115115
source_set("wifi-interface") {
116116
sources = [
117117
"${silabs_common_plat_dir}/wifi/WifiInterfaceAbstraction.cpp",
118+
"${silabs_common_plat_dir}/wifi/WiseconnectInterfaceAbstraction.cpp",
118119
"SiWxWifiInterface.cpp",
119120

120121
# Wi-Fi Config - Using the file sdk support until the wiseconnect file is fixed

examples/platform/silabs/SiWx917/SiWxWifiInterface.cpp

+56-39
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "FreeRTOS.h"
3131
#include "WifiInterfaceAbstraction.h"
32+
#include "WiseconnectInterfaceAbstraction.h"
3233
#include "ble_config.h"
3334
#include "dhcp_client.h"
3435
#include "event_groups.h"
@@ -45,15 +46,13 @@
4546
#include <lib/support/logging/CHIPLogging.h>
4647

4748
extern "C" {
48-
#include "sl_net.h"
4949
#include "sl_si91x_driver.h"
5050
#include "sl_si91x_host_interface.h"
5151
#include "sl_si91x_types.h"
5252
#include "sl_wifi.h"
5353
#include "sl_wifi_callback_framework.h"
5454
#include "sl_wifi_constants.h"
5555
#include "sl_wifi_types.h"
56-
#include "wfx_host_events.h"
5756
#if SL_MBEDTLS_USE_TINYCRYPT
5857
#include "sl_si91x_constants.h"
5958
#include "sl_si91x_trng.h"
@@ -440,6 +439,38 @@ sl_status_t JoinWifiNetwork(void)
440439

441440
} // namespace
442441

442+
/**
443+
* @brief Wifi initialization called from app main
444+
*
445+
* @return sl_status_t Returns underlying Wi-Fi initialization error
446+
*/
447+
sl_status_t sl_matter_wifi_platform_init(void)
448+
{
449+
sl_status_t status = SL_STATUS_OK;
450+
451+
status = sl_net_init((sl_net_interface_t) SL_NET_WIFI_CLIENT_INTERFACE, &config, &wifi_client_context, nullptr);
452+
VerifyOrReturnError(status == SL_STATUS_OK, status, ChipLogError(DeviceLayer, "sl_net_init failed: %lx", status));
453+
454+
// Create Sempaphore for scan completion
455+
sScanCompleteSemaphore = osSemaphoreNew(1, 0, nullptr);
456+
VerifyOrReturnError(sScanCompleteSemaphore != nullptr, SL_STATUS_ALLOCATION_FAILED);
457+
458+
// Create Semaphore for scan in-progress protection
459+
sScanInProgressSemaphore = osSemaphoreNew(1, 1, nullptr);
460+
VerifyOrReturnError(sScanCompleteSemaphore != nullptr, SL_STATUS_ALLOCATION_FAILED);
461+
462+
// Create the message queue
463+
sWifiEventQueue = osMessageQueueNew(kWfxQueueSize, sizeof(WifiEvent), nullptr);
464+
VerifyOrReturnError(sWifiEventQueue != nullptr, SL_STATUS_ALLOCATION_FAILED);
465+
466+
// Create timer for DHCP polling
467+
// TODO: Use LWIP timer instead of creating a new one here
468+
sDHCPTimer = osTimerNew(DHCPTimerEventHandler, osTimerPeriodic, nullptr, nullptr);
469+
VerifyOrReturnError(sDHCPTimer != nullptr, SL_STATUS_ALLOCATION_FAILED);
470+
471+
return status;
472+
}
473+
443474
/******************************************************************
444475
* @fn int32_t wfx_rsi_get_ap_info(wfx_wifi_scan_result_t *ap)
445476
* @brief
@@ -614,7 +645,7 @@ sl_status_t show_scan_results(sl_wifi_scan_result_t * scan_result)
614645
// if user has provided ssid, then check if the current scan result ssid matches the user provided ssid
615646
if (wfx_rsi.scan_ssid != nullptr &&
616647
(strncmp(wfx_rsi.scan_ssid, cur_scan_result.ssid, std::min(strlen(wfx_rsi.scan_ssid), strlen(cur_scan_result.ssid))) ==
617-
CMP_SUCCESS))
648+
0))
618649
{
619650
continue;
620651
}
@@ -838,38 +869,6 @@ void ProcessEvent(WifiEvent event)
838869
}
839870
}
840871

841-
/**
842-
* @brief Wifi initialization called from app main
843-
*
844-
* @return sl_status_t Returns underlying Wi-Fi initialization error
845-
*/
846-
sl_status_t sl_matter_wifi_platform_init(void)
847-
{
848-
sl_status_t status = SL_STATUS_OK;
849-
850-
status = sl_net_init((sl_net_interface_t) SL_NET_WIFI_CLIENT_INTERFACE, &config, &wifi_client_context, nullptr);
851-
VerifyOrReturnError(status == SL_STATUS_OK, status, ChipLogError(DeviceLayer, "sl_net_init failed: %lx", status));
852-
853-
// Create Sempaphore for scan completion
854-
sScanCompleteSemaphore = osSemaphoreNew(1, 0, nullptr);
855-
VerifyOrReturnError(sScanCompleteSemaphore != nullptr, SL_STATUS_ALLOCATION_FAILED);
856-
857-
// Create Semaphore for scan in-progress protection
858-
sScanInProgressSemaphore = osSemaphoreNew(1, 1, nullptr);
859-
VerifyOrReturnError(sScanCompleteSemaphore != nullptr, SL_STATUS_ALLOCATION_FAILED);
860-
861-
// Create the message queue
862-
sWifiEventQueue = osMessageQueueNew(kWfxQueueSize, sizeof(WifiEvent), nullptr);
863-
VerifyOrReturnError(sWifiEventQueue != nullptr, SL_STATUS_ALLOCATION_FAILED);
864-
865-
// Create timer for DHCP polling
866-
// TODO: Use LWIP timer instead of creating a new one here
867-
sDHCPTimer = osTimerNew(DHCPTimerEventHandler, osTimerPeriodic, nullptr, nullptr);
868-
VerifyOrReturnError(sDHCPTimer != nullptr, SL_STATUS_ALLOCATION_FAILED);
869-
870-
return status;
871-
}
872-
873872
/*********************************************************************************
874873
* @fn void sl_matter_wifi_task(void *arg)
875874
* @brief
@@ -922,14 +921,32 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
922921
/*
923922
* Acquire the new IP address
924923
*/
925-
wfx_rsi.ip4_addr[0] = (ip) &HEX_VALUE_FF;
926-
wfx_rsi.ip4_addr[1] = (ip >> 8) & HEX_VALUE_FF;
927-
wfx_rsi.ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF;
928-
wfx_rsi.ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF;
924+
wfx_rsi.ip4_addr[0] = (ip) &0xFF;
925+
wfx_rsi.ip4_addr[1] = (ip >> 8) & 0xFF;
926+
wfx_rsi.ip4_addr[2] = (ip >> 16) & 0xFF;
927+
wfx_rsi.ip4_addr[3] = (ip >> 24) & 0xFF;
929928
ChipLogDetail(DeviceLayer, "DHCP OK: IP=%d.%d.%d.%d", wfx_rsi.ip4_addr[0], wfx_rsi.ip4_addr[1], wfx_rsi.ip4_addr[2],
930929
wfx_rsi.ip4_addr[3]);
931930
/* Notify the Connectivity Manager - via the app */
932931
wfx_rsi.dev_state.Set(WifiState::kStationDhcpDone).Set(WifiState::kStationReady);
933932
wfx_ip_changed_notify(IP_STATUS_SUCCESS);
934933
}
935934
#endif /* CHIP_DEVICE_CONFIG_ENABLE_IPV4 */
935+
936+
#if SL_ICD_ENABLED
937+
/*********************************************************************
938+
* @fn sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state, sl_si91x_performance_profile_t
939+
sl_si91x_wifi_state)
940+
* @brief
941+
* Implements the power save in sleepy application
942+
* @param[in] sl_si91x_ble_state : State to set for the BLE
943+
sl_si91x_wifi_state : State to set for the WiFi
944+
* @return SL_STATUS_OK if successful,
945+
* SL_STATUS_FAIL otherwise
946+
***********************************************************************/
947+
sl_status_t wfx_power_save(rsi_power_save_profile_mode_t sl_si91x_ble_state,
948+
sl_si91x_performance_profile_t sl_si91x_wifi_state) // TODO : Figure out why the extern C is necessary
949+
{
950+
return (wfx_rsi_power_save(sl_si91x_ble_state, sl_si91x_wifi_state) ? SL_STATUS_FAIL : SL_STATUS_OK);
951+
}
952+
#endif

examples/platform/silabs/efr32/rs911x/Rsi91xWifiInterface.cpp

+32-6
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extern "C" {
5050
#endif
5151

5252
#include "WifiInterfaceAbstraction.h"
53+
#include "WiseconnectInterfaceAbstraction.h"
5354
#include "dhcp_client.h"
5455
#include "ethernetif.h"
5556
#include "lwip/nd6.h"
@@ -60,8 +61,20 @@ extern "C" {
6061
#include <lib/support/CodeUtils.h>
6162
#include <lib/support/logging/CHIPLogging.h>
6263

64+
using WifiStateFlags = chip::BitFlags<WifiState>;
65+
6366
#define WFX_QUEUE_SIZE 10
6467
#define WFX_RSI_BUF_SZ (1024 * 10)
68+
#define RSI_RESPONSE_MAX_SIZE (28)
69+
#define RSI_RESPONSE_HOLD_BUFF_SIZE (128)
70+
#define RSI_DRIVER_STATUS (0)
71+
#define OPER_MODE_0 (0)
72+
#define COEX_MODE_0 (0)
73+
#define RESP_BUFF_SIZE (6)
74+
#define AP_CHANNEL_NO_0 (0)
75+
#define SCAN_BITMAP_OPTN_1 (1)
76+
77+
WfxRsi_t wfx_rsi;
6578

6679
static osThreadId_t sDrvThread;
6780
constexpr uint32_t kDrvTaskSize = 1792;
@@ -750,7 +763,7 @@ void ProcessEvent(WifiEvent event)
750763
chip::Platform::CopyString(ap.ssid, ap.ssid_length, reinterpret_cast<char *>(scan->ssid));
751764

752765
// check if the scanned ssid is the one we are looking for
753-
if (wfx_rsi.scan_ssid_length != 0 && strncmp(wfx_rsi.scan_ssid, ap.ssid, WFX_MAX_SSID_LENGTH) != CMP_SUCCESS)
766+
if (wfx_rsi.scan_ssid_length != 0 && strncmp(wfx_rsi.scan_ssid, ap.ssid, WFX_MAX_SSID_LENGTH) != 0)
754767
{
755768
continue; // we found the targeted ssid.
756769
}
@@ -861,10 +874,10 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
861874
/*
862875
* Acquire the new IP address
863876
*/
864-
wfx_rsi.ip4_addr[0] = (ip) &HEX_VALUE_FF;
865-
wfx_rsi.ip4_addr[1] = (ip >> 8) & HEX_VALUE_FF;
866-
wfx_rsi.ip4_addr[2] = (ip >> 16) & HEX_VALUE_FF;
867-
wfx_rsi.ip4_addr[3] = (ip >> 24) & HEX_VALUE_FF;
877+
wfx_rsi.ip4_addr[0] = (ip) &0xFF;
878+
wfx_rsi.ip4_addr[1] = (ip >> 8) & 0xFF;
879+
wfx_rsi.ip4_addr[2] = (ip >> 16) & 0xFF;
880+
wfx_rsi.ip4_addr[3] = (ip >> 24) & 0xFF;
868881
ChipLogProgress(DeviceLayer, "DHCP OK: IP=%d.%d.%d.%d", wfx_rsi.ip4_addr[0], wfx_rsi.ip4_addr[1], wfx_rsi.ip4_addr[2],
869882
wfx_rsi.ip4_addr[3]);
870883
/* Notify the Connectivity Manager - via the app */
@@ -960,4 +973,17 @@ int32_t wfx_rsi_send_data(void * p, uint16_t len)
960973
return status;
961974
}
962975

963-
WfxRsi_t wfx_rsi;
976+
#if SL_ICD_ENABLED
977+
/*********************************************************************
978+
* @fn sl_status_t wfx_power_save(void)
979+
* @brief
980+
* Implements the power save in sleepy application
981+
* @param[in] None
982+
* @return SL_STATUS_OK if successful,
983+
* SL_STATUS_FAIL otherwise
984+
***********************************************************************/
985+
sl_status_t wfx_power_save(void) // TODO : Figure out why the extern C is necessary
986+
{
987+
return (wfx_rsi_power_save() ? SL_STATUS_FAIL : SL_STATUS_OK);
988+
}
989+
#endif /* SL_ICD_ENABLED */

examples/platform/silabs/efr32/rs911x/hal/efx_spi.c

+10-8
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343

4444
#include "silabs_utils.h"
4545
#include "spi_multiplex.h"
46-
#include "wfx_host_events.h"
4746

4847
#ifdef SL_BOARD_NAME
4948
#include "sl_board_control.h"
@@ -74,6 +73,9 @@
7473
#define SL_SPIDRV_HANDLE sl_spidrv_eusart_exp_handle
7574
#define SL_SPIDRV_EXP_BITRATE_MULTIPLEXED SL_SPIDRV_EUSART_EXP_BITRATE
7675

76+
#define MIN_XLEN (0)
77+
#define WFX_SPI_NVIC_PRIORITY (5)
78+
7779
#define CONCAT(A, B) (A##B)
7880
#define SPI_CLOCK(N) CONCAT(cmuClock_USART, N)
7981
// Macro to drive semaphore block minimun timer in milli seconds
@@ -110,16 +112,16 @@ void sl_wfx_host_gpio_init(void)
110112
CMU_ClockEnable(cmuClock_GPIO, true);
111113

112114
// Set CS pin to high/inactive
113-
GPIO_PinModeSet(SL_SPIDRV_EUSART_EXP_CS_PORT, SL_SPIDRV_EUSART_EXP_CS_PIN, gpioModePushPull, PINOUT_SET);
115+
GPIO_PinModeSet(SL_SPIDRV_EUSART_EXP_CS_PORT, SL_SPIDRV_EUSART_EXP_CS_PIN, gpioModePushPull, 1);
114116

115-
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, PINOUT_SET);
116-
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModePushPull, PINOUT_CLEAR);
117+
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, 1);
118+
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModePushPull, 0);
117119

118120
CMU_OscillatorEnable(cmuOsc_LFXO, true, true);
119121

120122
// Set up interrupt based callback function - trigger on both edges.
121123
GPIOINT_Init();
122-
GPIO_PinModeSet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin, gpioModeInputPull, PINOUT_CLEAR);
124+
GPIO_PinModeSet(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin, gpioModeInputPull, 0);
123125
GPIO_ExtIntConfig(WFX_INTERRUPT_PIN.port, WFX_INTERRUPT_PIN.pin, SL_WFX_HOST_PINOUT_SPI_IRQ, true, false, true);
124126
GPIOINT_CallbackRegister(SL_WFX_HOST_PINOUT_SPI_IRQ, rsi_gpio_irq_cb);
125127
GPIO_IntDisable(1 << SL_WFX_HOST_PINOUT_SPI_IRQ); /* Will be enabled by RSI */
@@ -204,7 +206,7 @@ sl_status_t sl_wfx_host_spi_cs_deassert(void)
204206
if (SL_STATUS_OK == status)
205207
{
206208
GPIO_PinOutSet(SL_SPIDRV_EUSART_EXP_CS_PORT, SL_SPIDRV_EUSART_EXP_CS_PIN);
207-
GPIO->EUSARTROUTE[SL_SPIDRV_EUSART_EXP_PERIPHERAL_NO].ROUTEEN = PINOUT_CLEAR;
209+
GPIO->EUSARTROUTE[SL_SPIDRV_EUSART_EXP_PERIPHERAL_NO].ROUTEEN = 0;
208210
spi_enabled = false;
209211
}
210212
}
@@ -267,7 +269,7 @@ sl_status_t sl_wfx_host_post_bootloader_spi_transfer(void)
267269
#endif // SL_SPICTRL_MUX
268270
return SL_STATUS_FAIL;
269271
}
270-
GPIO->USARTROUTE[SL_MX25_FLASH_SHUTDOWN_PERIPHERAL_NO].ROUTEEN = PINOUT_CLEAR;
272+
GPIO->USARTROUTE[SL_MX25_FLASH_SHUTDOWN_PERIPHERAL_NO].ROUTEEN = 0;
271273
#if SL_MX25CTRL_MUX
272274
sl_wfx_host_spiflash_cs_deassert();
273275
#endif // SL_MX25CTRL_MUX
@@ -300,7 +302,7 @@ sl_status_t sl_wfx_host_post_lcd_spi_transfer(void)
300302
{
301303
USART_Enable(SL_MEMLCD_SPI_PERIPHERAL, usartDisable);
302304
CMU_ClockEnable(SPI_CLOCK(SL_MEMLCD_SPI_PERIPHERAL_NO), false);
303-
GPIO->USARTROUTE[SL_MEMLCD_SPI_PERIPHERAL_NO].ROUTEEN = PINOUT_CLEAR;
305+
GPIO->USARTROUTE[SL_MEMLCD_SPI_PERIPHERAL_NO].ROUTEEN = 0;
304306
sl_status_t status = sl_board_disable_display();
305307
#if SL_SPICTRL_MUX
306308
xSemaphoreGive(spi_sem_sync_hdl);

examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_interrupt.c

-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#include "event_groups.h"
3636
#include "task.h"
3737

38-
#include "wfx_host_events.h"
39-
4038
#if (SLI_SI91X_MCU_INTERFACE | EXP_BOARD)
4139
#include "sl_board_configuration.h"
4240

examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_ioports.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#include "event_groups.h"
3636
#include "task.h"
3737

38-
#include "wfx_host_events.h"
39-
4038
#include "rsi_board_configuration.h"
4139
#include "rsi_driver.h"
4240
/*===========================================================*/
@@ -63,17 +61,17 @@ void rsi_hal_config_gpio(uint8_t gpio_number, uint8_t mode, uint8_t value)
6361
{
6462
case RSI_HAL_SLEEP_CONFIRM_PIN:
6563
case RSI_HAL_LP_SLEEP_CONFIRM_PIN:
66-
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, PINOUT_SET);
64+
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);
6765
break;
6866
case RSI_HAL_WAKEUP_INDICATION_PIN:
6967
#ifndef LOGGING_STATS
70-
GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, PINOUT_CLEAR);
68+
GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, 0);
7169
#else
72-
GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, PINOUT_CLEAR);
70+
GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeWiredOrPullDown, 0);
7371
#endif
7472
break;
7573
case RSI_HAL_RESET_PIN:
76-
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, PINOUT_SET);
74+
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModePushPull, 1);
7775
break;
7876
default:
7977
break;
@@ -95,17 +93,17 @@ void rsi_hal_set_gpio(uint8_t gpio_number)
9593
{
9694
case RSI_HAL_SLEEP_CONFIRM_PIN:
9795
case RSI_HAL_LP_SLEEP_CONFIRM_PIN:
98-
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, PINOUT_SET);
96+
GPIO_PinModeSet(WFX_SLEEP_CONFIRM_PIN.port, WFX_SLEEP_CONFIRM_PIN.pin, gpioModeWiredOrPullDown, 1);
9997
break;
10098
case RSI_HAL_WAKEUP_INDICATION_PIN:
10199
#ifndef LOGGING_STATS
102-
GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeInput, PINOUT_SET);
100+
GPIO_PinModeSet(WAKE_INDICATOR_PIN.port, WAKE_INDICATOR_PIN.pin, gpioModeInput, 1);
103101
#else
104-
GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeInput, PINOUT_SET);
102+
GPIO_PinModeSet(LOGGING_WAKE_INDICATOR_PIN.port, LOGGING_WAKE_INDICATOR_PIN.pin, gpioModeInput, 1);
105103
#endif
106104
break;
107105
case RSI_HAL_RESET_PIN:
108-
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModeWiredOrPullDown, PINOUT_SET);
106+
GPIO_PinModeSet(WFX_RESET_PIN.port, WFX_RESET_PIN.pin, gpioModeWiredOrPullDown, 1);
109107
break;
110108
default:
111109
break;

examples/platform/silabs/efr32/rs911x/hal/rsi_hal_mcu_timer.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ extern void SysTick_Handler(void);
3434
extern void xPortSysTickHandler(void);
3535
#endif /* SysTick */
3636
#endif /* RSI_WITH_OS */
37-
#include "wfx_host_events.h"
38-
3937
/* RSI Driver include file */
4038
#include "rsi_driver.h"
4139
/* RSI WLAN Config include file */
@@ -51,6 +49,8 @@ extern void xPortSysTickHandler(void);
5149
#include "rsi_wlan_config.h"
5250

5351
#define WFX_RSI_NUM_TIMERS (2) /* Number of RSI timers to alloc */
52+
#define CONVERT_SEC_TO_MSEC (1000)
53+
#define CONVERT_USEC_TO_MSEC (1 / 1000)
5454

5555
#ifndef _use_the_rsi_defined_functions
5656

@@ -135,7 +135,7 @@ int32_t rsi_timer_start(uint8_t timer_node, uint8_t mode, uint8_t type, uint32_t
135135
return RSI_ERROR_INSUFFICIENT_BUFFER;
136136
}
137137

138-
(void) xTimerStart(tp->handle, TIMER_TICKS_TO_WAIT_0);
138+
(void) xTimerStart(tp->handle, pdMS_TO_TICKS(0));
139139

140140
return RSI_ERROR_NONE;
141141
}

0 commit comments

Comments
 (0)