esp-idf/components/esp_hw_support/port/esp32h2/systimer.c
morris 45524408df coverity: fix uninit variable issue in driver
Related CID:
389832, 389838, 389880, 286743, 286752, 395156, 291011, 396001, 396002
2022-08-03 10:46:50 +08:00

23 lines
471 B
C

/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_private/systimer.h"
/**
* @brief systimer's clock source is fixed to XTAL (32MHz), and has a fixed fractional divider (2.0).
* So the resolution of the systimer is 32MHz/2.0 = 16MHz.
*/
uint64_t systimer_ticks_to_us(uint64_t ticks)
{
return ticks / 16;
}
uint64_t systimer_us_to_ticks(uint64_t us)
{
return us * 16;
}