mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
soc, hal: remove XTAL_CLK_FREQ
XTAL_CLK_FREQ now depends on the actual XTAL used, remove this macro and get the XTAL frequency from the RTC register instead. No uses of XTAL_CLK_FREQ found, other than in the UART LL.
This commit is contained in:
committed by
songruojing
parent
a1d7089b59
commit
2e37218ce5
@@ -11,6 +11,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "hal/uart_types.h"
|
#include "hal/uart_types.h"
|
||||||
#include "soc/uart_periph.h"
|
#include "soc/uart_periph.h"
|
||||||
|
#include "hal/clk_tree_ll.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -157,7 +158,7 @@ static inline uint32_t uart_ll_get_sclk_freq(uart_dev_t *hw)
|
|||||||
case 2:
|
case 2:
|
||||||
return RTC_CLK_FREQ;
|
return RTC_CLK_FREQ;
|
||||||
case 3:
|
case 3:
|
||||||
return XTAL_CLK_FREQ;
|
return clk_ll_xtal_load_freq_mhz() * MHZ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -148,7 +148,6 @@
|
|||||||
#define APB_CLK_FREQ ( 40*1000000 )
|
#define APB_CLK_FREQ ( 40*1000000 )
|
||||||
#define REF_CLK_FREQ ( 1000000 )
|
#define REF_CLK_FREQ ( 1000000 )
|
||||||
#define RTC_CLK_FREQ (20*1000000)
|
#define RTC_CLK_FREQ (20*1000000)
|
||||||
#define XTAL_CLK_FREQ (40*1000000)
|
|
||||||
#define UART_CLK_FREQ APB_CLK_FREQ
|
#define UART_CLK_FREQ APB_CLK_FREQ
|
||||||
#define WDT_CLK_FREQ APB_CLK_FREQ
|
#define WDT_CLK_FREQ APB_CLK_FREQ
|
||||||
#define TIMER_CLK_FREQ (80000000>>4) //80MHz divided by 4
|
#define TIMER_CLK_FREQ (80000000>>4) //80MHz divided by 4
|
||||||
|
Reference in New Issue
Block a user