mirror of https://github.com/ARMmbed/mbed-os.git
MIMXRT1050: Update the usticker driver
The PIT module should be initialized only once Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>pull/12095/head
parent
2d32e43713
commit
3a0269c805
|
@ -50,18 +50,18 @@ void us_ticker_init(void)
|
|||
{
|
||||
/* Common for ticker/timer. */
|
||||
uint32_t busClock;
|
||||
/* Structure to initialize PIT. */
|
||||
pit_config_t pitConfig;
|
||||
|
||||
us_ticker_setup_clock();
|
||||
|
||||
PIT_GetDefaultConfig(&pitConfig);
|
||||
PIT_Init(PIT, &pitConfig);
|
||||
|
||||
busClock = us_ticker_get_clock();
|
||||
|
||||
/* Let the timer to count if re-init. */
|
||||
if (!us_ticker_inited) {
|
||||
/* Structure to initialize PIT. */
|
||||
pit_config_t pitConfig;
|
||||
|
||||
PIT_GetDefaultConfig(&pitConfig);
|
||||
PIT_Init(PIT, &pitConfig);
|
||||
|
||||
PIT_SetTimerPeriod(PIT, kPIT_Chnl_0, busClock / 1000000 - 1);
|
||||
PIT_SetTimerPeriod(PIT, kPIT_Chnl_1, 0xFFFFFFFF);
|
||||
|
|
Loading…
Reference in New Issue