Skip to content

Commit

Permalink
[rtl872x] fix sleep-wakeup/wifi-reconnection issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
XuGuohui committed Apr 25, 2023
1 parent ac32257 commit b8d9002
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion hal/network/ncp_client/realtek/rtl_ncp_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,12 +439,19 @@ int RealtekNcpClient::scan(WifiScanCallback callback, void* data) {
// Workaround for a weird state we might enter where the wifi driver
// is not returning any results
hal_ble_lock(nullptr);
bool advertising = hal_ble_gap_is_advertising(nullptr) ||
hal_ble_gap_is_connecting(nullptr, nullptr) ||
hal_ble_gap_is_connected(nullptr, nullptr);
hal_ble_stack_deinit(nullptr);
wifi_off();
RCC_PeriphClockCmd(APBPeriph_WL, APBPeriph_WL_CLOCK, DISABLE);
RCC_PeriphClockCmd(APBPeriph_WL, APBPeriph_WL_CLOCK, ENABLE);
SPARK_ASSERT(wifi_on(RTW_MODE_STA) == 0);
hal_ble_stack_init(nullptr);
if (hal_ble_stack_init(nullptr) == SYSTEM_ERROR_NONE) {
if (advertising) {
hal_ble_gap_start_advertising(nullptr);
}
}
hal_ble_unlock(nullptr);
}
return rtl_error_to_system(rtlError);
Expand Down
2 changes: 1 addition & 1 deletion hal/src/rtl872x/hal_platform_rtl8721x_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
// No SOF support :(
#define HAL_PLATFORM_USB_SOF (0)

#define HAL_PLATFORM_SYSTEM_POOL_SIZE 1024
#define HAL_PLATFORM_SYSTEM_POOL_SIZE 8192

#define HAL_PLATFORM_MODULE_SUFFIX_EXTENSIONS (1)

Expand Down
2 changes: 1 addition & 1 deletion third_party/freertos/freertos

0 comments on commit b8d9002

Please sign in to comment.