Skip to content

Commit

Permalink
[SL-UP] Fix Builds after Wi-Fi interface refactor (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkardous-silabs authored Nov 18, 2024
1 parent a48b365 commit 67f03dd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 22 deletions.
7 changes: 7 additions & 0 deletions src/platform/silabs/SiWx917/SiWxPlatformInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@

#include <app/icd/server/ICDServerConfig.h>

namespace {
#ifdef ENABLE_CHIP_SHELL
bool ps_requirement_added = false;
#endif // ENABLE_CHIP_SHELL
} // namespace

#ifdef __cplusplus
extern "C" {
#endif
Expand All @@ -27,6 +33,7 @@ extern "C" {
#include "sl_si91x_button.h"
#include "sl_si91x_button_pin_config.h"
#include "sl_si91x_driver_gpio.h"
#include "sl_si91x_power_manager.h"

/**
* @brief invoked when button press event is received when in sleep
Expand Down
8 changes: 1 addition & 7 deletions src/platform/silabs/wifi/SiWx/WifiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,11 @@ extern "C" {
WfxRsi_t wfx_rsi;
extern osSemaphoreId_t sl_rs_ble_init_sem;

// [SLC-TEMP] Adding power manager include until we update wiseconnect version and upstream the changes
#include "sl_si91x_power_manager.h"

namespace {

#if CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
// TODO: should be removed once we are getting the press interrupt for button 0 with sleep
bool btn0_pressed = false;
#ifdef ENABLE_CHIP_SHELL
bool ps_requirement_added = false;
#endif // ENABLE_CHIP_SHELL
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE

bool hasNotifiedWifiConnectivity = false;
Expand Down Expand Up @@ -840,7 +834,7 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
/*
* Acquire the new IP address
*/
wfx_rsi.ip4_addr[0] = (ip) &0xFF;
wfx_rsi.ip4_addr[0] = (ip) & 0xFF;
wfx_rsi.ip4_addr[1] = (ip >> 8) & 0xFF;
wfx_rsi.ip4_addr[2] = (ip >> 16) & 0xFF;
wfx_rsi.ip4_addr[3] = (ip >> 24) & 0xFF;
Expand Down
1 change: 0 additions & 1 deletion src/platform/silabs/wifi/WifiInterfaceAbstraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ void sl_button_on_change(uint8_t btn, uint8_t btnAction);
#ifdef WF200_WIFI
void sl_wfx_host_gpio_init(void);
void wfx_bus_start(void);
sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload);
#endif /* WF200_WIFI */

#ifdef __cplusplus
Expand Down
14 changes: 2 additions & 12 deletions src/platform/silabs/wifi/wf200/WifiInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,16 +224,6 @@ typedef struct __attribute__((__packed__)) sl_wfx_mib_req_s

sl_wfx_get_counters_cnf_t * counters;

/****************************************************************************
* @brief
* get the wifi state
* @return returns wificonetext state
*****************************************************************************/
sl_wfx_state_t wfx_get_wifi_state(void)
{
return wifiContext.state;
}

sl_status_t get_all_counters(void)
{
sl_status_t result;
Expand Down Expand Up @@ -328,7 +318,7 @@ static void wfx_events_task_start(void)
* @returns Returns SL_STATUS_OK if successful,
*SL_STATUS_FAIL otherwise
*****************************************************************************/
sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload)
extern "C" sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload)
{
switch (event_payload->header.id)
{
Expand Down Expand Up @@ -1219,7 +1209,7 @@ void wfx_dhcp_got_ipv4(uint32_t ip)
*/
uint8_t ip4_addr[4];

ip4_addr[0] = (ip) &0xFF;
ip4_addr[0] = (ip) & 0xFF;
ip4_addr[1] = (ip >> 8) & 0xFF;
ip4_addr[2] = (ip >> 16) & 0xFF;
ip4_addr[3] = (ip >> 24) & 0xFF;
Expand Down
2 changes: 0 additions & 2 deletions src/platform/silabs/wifi/wf200/platform/efr_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ sl_status_t sl_wfx_host_post_lcd_spi_transfer(void)
#endif // SL_SPICTRL_MUX
return SL_STATUS_OK;
}
#else
#error still not working
#endif // SL_LCDCTRL_MUX

#if SL_UARTCTRL_MUX
Expand Down
3 changes: 3 additions & 0 deletions src/platform/silabs/wifi/wf200/platform/sl_wfx_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*/

//TODO: Should use the file from simplicity sdk

#pragma once

#include "FreeRTOS.h"
Expand All @@ -26,6 +28,7 @@
#ifdef __cplusplus
extern "C" {
#endif
sl_status_t sl_wfx_host_process_event(sl_wfx_generic_message_t * event_payload);
uint8_t sl_wfx_host_get_waited_event(void);
sl_status_t wfx_soft_init(void);

Expand Down

0 comments on commit 67f03dd

Please sign in to comment.