mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
kconfig: refactor xtal freq kconfig to common configuration item
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
* So the resolution of the systimer is 40MHz/2.5 = 16MHz, or 26MHz/2.5 = 10.4MHz.
|
||||
*/
|
||||
|
||||
#if CONFIG_ESP32C2_XTAL_FREQ_40
|
||||
#if CONFIG_XTAL_FREQ_40
|
||||
uint64_t systimer_ticks_to_us(uint64_t ticks)
|
||||
{
|
||||
return ticks / 16;
|
||||
@@ -22,7 +22,7 @@ uint64_t systimer_us_to_ticks(uint64_t us)
|
||||
{
|
||||
return us * 16;
|
||||
}
|
||||
#elif CONFIG_ESP32C2_XTAL_FREQ_26
|
||||
#elif CONFIG_XTAL_FREQ_26
|
||||
uint64_t systimer_ticks_to_us(uint64_t ticks)
|
||||
{
|
||||
return ticks * 5 / 52;
|
||||
@@ -34,4 +34,4 @@ uint64_t systimer_us_to_ticks(uint64_t us)
|
||||
}
|
||||
#else
|
||||
#error "Unsupported XTAL frequency by systimer"
|
||||
#endif // CONFIG_ESP32C2_XTAL_FREQ_xx
|
||||
#endif // CONFIG_XTAL_FREQ_xx
|
||||
|
Reference in New Issue
Block a user