Skip to content

Commit bcc8fff

Browse files
committed
MIMXRT1050: Update the usticker driver
The PIT module should be initialized only once Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 8561f4a commit bcc8fff

File tree

1 file changed

+5
-5
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX

1 file changed

+5
-5
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/us_ticker.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@ void us_ticker_init(void)
5050
{
5151
/* Common for ticker/timer. */
5252
uint32_t busClock;
53-
/* Structure to initialize PIT. */
54-
pit_config_t pitConfig;
5553

5654
us_ticker_setup_clock();
5755

58-
PIT_GetDefaultConfig(&pitConfig);
59-
PIT_Init(PIT, &pitConfig);
60-
6156
busClock = us_ticker_get_clock();
6257

6358
/* Let the timer to count if re-init. */
6459
if (!us_ticker_inited) {
60+
/* Structure to initialize PIT. */
61+
pit_config_t pitConfig;
62+
63+
PIT_GetDefaultConfig(&pitConfig);
64+
PIT_Init(PIT, &pitConfig);
6565

6666
PIT_SetTimerPeriod(PIT, kPIT_Chnl_0, busClock / 1000000 - 1);
6767
PIT_SetTimerPeriod(PIT, kPIT_Chnl_1, 0xFFFFFFFF);

0 commit comments

Comments
 (0)