|
19 | 19 | #include <stdlib.h>
|
20 | 20 | #include <string.h>
|
21 | 21 |
|
| 22 | +#if (SL_MATTER_GN_BUILD == 0) |
| 23 | +#include "sl_matter_wifi_config.h" |
| 24 | +#endif // SL_MATTER_GN_BUILD |
| 25 | + |
22 | 26 | #include "sl_status.h"
|
23 | 27 | #include <app/icd/server/ICDServerConfig.h>
|
24 | 28 | #include <inet/IPAddress.h>
|
@@ -52,9 +56,15 @@ extern "C" {
|
52 | 56 | #include "sl_si91x_m4_ps.h"
|
53 | 57 | }
|
54 | 58 |
|
| 59 | +namespace { |
55 | 60 | // TODO: should be removed once we are getting the press interrupt for button 0 with sleep
|
56 | 61 | #define BUTTON_PRESSED 1
|
57 | 62 | bool btn0_pressed = false;
|
| 63 | + |
| 64 | +#ifdef ENABLE_CHIP_SHELL |
| 65 | +bool ps_requirement_added = false; |
| 66 | +#endif // ENABLE_CHIP_SHELL |
| 67 | +} // namespace |
58 | 68 | #endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI91X_MCU_INTERFACE
|
59 | 69 |
|
60 | 70 | #include "dhcp_client.h"
|
@@ -288,6 +298,26 @@ void sl_si91x_invoke_btn_press_event()
|
288 | 298 | {
|
289 | 299 | btn0_pressed = false;
|
290 | 300 | }
|
| 301 | + |
| 302 | +#ifdef ENABLE_CHIP_SHELL |
| 303 | + // Checking the UULP PIN 1 status to reinit the UART and not allow the device to go to sleep |
| 304 | + if (RSI_NPSSGPIO_GetPin(RTE_UULP_GPIO_1_PIN)) |
| 305 | + { |
| 306 | + if (!ps_requirement_added) |
| 307 | + { |
| 308 | + sl_si91x_power_manager_add_ps_requirement(SL_SI91X_POWER_MANAGER_PS4); |
| 309 | + ps_requirement_added = true; |
| 310 | + } |
| 311 | + } |
| 312 | + else |
| 313 | + { |
| 314 | + if (ps_requirement_added) |
| 315 | + { |
| 316 | + sl_si91x_power_manager_remove_ps_requirement(SL_SI91X_POWER_MANAGER_PS4); |
| 317 | + ps_requirement_added = false; |
| 318 | + } |
| 319 | + } |
| 320 | +#endif // ENABLE_CHIP_SHELL |
291 | 321 | }
|
292 | 322 |
|
293 | 323 | /******************************************************************
|
@@ -426,6 +456,16 @@ static sl_status_t wfx_rsi_init(void)
|
426 | 456 | ChipLogError(DeviceLayer, "sl_si91x_m4_ta_secure_handshake failed: 0x%lx", static_cast<uint32_t>(status));
|
427 | 457 | return status;
|
428 | 458 | }
|
| 459 | +#ifdef ENABLE_CHIP_SHELL |
| 460 | + // While using the matter shell with the ICD server, the GPIO 1 is used to check the UULP PIN 1 status |
| 461 | + // since UART doesn't act as a wakeup source in the UULP mode |
| 462 | + /*Configuring the NPS GPIO 1*/ |
| 463 | + RSI_NPSSGPIO_SetPinMux(RTE_UULP_GPIO_1_PIN, 0); |
| 464 | + /*Configure the NPSS GPIO direction to input */ |
| 465 | + RSI_NPSSGPIO_SetDir(RTE_UULP_GPIO_1_PIN, 1); |
| 466 | + /*Enable the REN*/ |
| 467 | + RSI_NPSSGPIO_InputBufferEn(RTE_UULP_GPIO_1_PIN, 1); |
| 468 | +#endif // ENABLE_CHIP_SHELL |
429 | 469 | #endif /* CHIP_CONFIG_ENABLE_ICD_SERVER */
|
430 | 470 | #endif /* SLI_SI91X_MCU_INTERFACE */
|
431 | 471 |
|
@@ -647,7 +687,7 @@ static sl_status_t wfx_rsi_do_join(void)
|
647 | 687 | case WFX_SEC_WPA3:
|
648 | 688 | ap.security = SL_WIFI_WPA3_TRANSITION;
|
649 | 689 | #else
|
650 |
| - ap.security = SL_WIFI_WPA_WPA2_MIXED; |
| 690 | + ap.security = SL_WIFI_WPA_WPA2_MIXED; |
651 | 691 | #endif // WIFI_ENABLE_SECURITY_WPA3_TRANSITION
|
652 | 692 | break;
|
653 | 693 | case WFX_SEC_NONE:
|
|
0 commit comments