mimxrt/machine_timer: Leave the Timer clock source at IPG clock.

Setting it to OSC_CLK interferes the utime module's functionality.  This is
still an area demanding an understanding.
This commit is contained in:
robert-hh
2021-06-02 09:00:05 +02:00
committed by Damien George
parent cdd95ce737
commit d79105d7c0

View File

@@ -36,7 +36,7 @@
#define TIMER_MIN_PERIOD 1 #define TIMER_MIN_PERIOD 1
#define alarm_callback PIT_IRQHandler #define alarm_callback PIT_IRQHandler
#define PIT_SOURCE_CLOCK CLOCK_GetFreq(kCLOCK_OscClk) #define PIT_SOURCE_CLOCK CLOCK_GetIpgFreq()
#define PIT_IRQ_ID PIT_IRQn #define PIT_IRQ_ID PIT_IRQn
typedef struct _machine_timer_obj_t { typedef struct _machine_timer_obj_t {
@@ -194,8 +194,6 @@ void machine_timer_init_PIT(void) {
// PIT timer // PIT timer
// Enable clock gate for GPIO1 // Enable clock gate for GPIO1
CLOCK_EnableClock(kCLOCK_Gpio1); // ? CLOCK_EnableClock(kCLOCK_Gpio1); // ?
// Set PERCLK_CLK source to OSC_CLK
CLOCK_SetMux(kCLOCK_PerclkMux, 1U);
// Set PERCLK_CLK divider to 1 // Set PERCLK_CLK divider to 1
CLOCK_SetDiv(kCLOCK_PerclkDiv, 0U); CLOCK_SetDiv(kCLOCK_PerclkDiv, 0U);