kconfig: refactor xtal freq kconfig to common configuration item

This commit is contained in:
jingli
2022-07-13 10:54:41 +08:00
parent a61abcc22e
commit ee3423834e
54 changed files with 197 additions and 154 deletions

View File

@@ -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