mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-11 04:57:38 +00:00
feat(gptimer): make start and stop function idempotent
Closes https://github.com/espressif/esp-idf/issues/12325 Closes https://github.com/espressif/esp-idf/issues/13486
This commit is contained in:
@@ -1,18 +1,14 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <sys/lock.h>
|
||||
#include "esp_check.h"
|
||||
#include "esp_clk_tree.h"
|
||||
#include "esp_private/esp_clk_tree_common.h"
|
||||
#include "esp_private/gptimer.h"
|
||||
#include "gptimer_priv.h"
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
static const char *TAG = "gptimer";
|
||||
#include "esp_private/esp_clk_tree_common.h"
|
||||
|
||||
typedef struct gptimer_platform_t {
|
||||
_lock_t mutex; // platform level mutex lock
|
||||
@@ -182,3 +178,11 @@ int gptimer_get_group_id(gptimer_handle_t timer, int *group_id)
|
||||
*group_id = timer->group->group_id;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
#if CONFIG_GPTIMER_ENABLE_DEBUG_LOG
|
||||
__attribute__((constructor))
|
||||
static void gptimer_override_default_log_level(void)
|
||||
{
|
||||
esp_log_level_set(TAG, ESP_LOG_VERBOSE);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user