Skip to content

Commit

Permalink
chore: added nimble_port_freertos_get_hs_hwm() visibility for ESP32 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
devmirek committed Jun 2, 2024
1 parent e46123a commit c0dfb63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
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

0 comments on commit c0dfb63

Please sign in to comment.