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
Mahesh Mahadevan 2019-11-08 10:18:47 -06:00
parent 2d32e43713
commit 3a0269c805
1 changed files with 5 additions and 5 deletions

View File

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