esp-idf/components/log/log_noos.c
Guillaume Souchere 6005cc9163 hal: Deprecate interrupt_controller_hal.h, cpu_hal.h and cpu_ll.h interfaces
This commit marks all functions in interrupt_controller_hal.h, cpu_ll.h and cpu_hal.h as deprecated.
Users should use functions from esp_cpu.h instead.
2022-07-22 00:06:06 +08:00

39 lines
760 B
C

/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <assert.h>
#include "esp_log_private.h"
#include "esp_rom_sys.h"
#include "esp_cpu.h"
static int s_lock = 0;
void esp_log_impl_lock(void)
{
assert(s_lock == 0);
s_lock = 1;
}
bool esp_log_lock_impl_timeout(void)
{
esp_log_impl_lock();
return true;
}
void esp_log_impl_unlock(void)
{
assert(s_lock == 1);
s_lock = 0;
}
/* FIXME: define an API for getting the timestamp in soc/hal IDF-2351 */
uint32_t esp_log_early_timestamp(void)
{
return esp_cpu_get_cycle_count() / (esp_rom_get_cpu_ticks_per_us() * 1000);
}
uint32_t esp_log_timestamp(void) __attribute__((alias("esp_log_early_timestamp")));