Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added nimble_port_freertos_get_hs_hwm() visibility for ESP32 platform #654

Merged
merged 1 commit into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ esp_err_t esp_nimble_disable(void);

void nimble_port_freertos_init(TaskFunction_t host_task_fn);
void nimble_port_freertos_deinit(void);
UBaseType_t nimble_port_freertos_get_hs_hwm(void);

#if CONFIG_NIMBLE_STACK_USE_MEM_POOLS
void npl_freertos_funcs_init(void);
Expand All @@ -60,7 +61,6 @@ struct npl_funcs_t * npl_freertos_funcs_get(void);

#ifndef ESP_PLATFORM
UBaseType_t nimble_port_freertos_get_ll_hwm(void);
UBaseType_t nimble_port_freertos_get_hs_hwm(void);
#endif

#ifdef __cplusplus
Expand Down
15 changes: 8 additions & 7 deletions src/nimble/porting/npl/freertos/src/nimble_port_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ static StaticTask_t hs_xTaskBuffer;

static TaskHandle_t host_task_h = NULL;

UBaseType_t nimble_port_freertos_get_hs_hwm(void) {
if (host_task_h == NULL)
return 0;
return uxTaskGetStackHighWaterMark(host_task_h);
}

#ifdef ESP_PLATFORM
/**
* @brief esp_nimble_enable - Initialize the NimBLE host
Expand Down Expand Up @@ -121,14 +127,9 @@ nimble_port_freertos_deinit(void)
UBaseType_t
nimble_port_freertos_get_ll_hwm(void)
{
if (ll_task_h == NULL)
return 0;
return uxTaskGetStackHighWaterMark(ll_task_h);
}
#endif

UBaseType_t
nimble_port_freertos_get_hs_hwm(void)
{
return uxTaskGetStackHighWaterMark(host_task_h);
}

#endif //ESP_PLATFORM
Loading