Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK;
cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX);
timer_base->CMP = cmp_timer;

/* NOTE: When engine is clocked by low power clock source (LXT/LIRC), we need to wait for 3 engine clocks. */
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this wait still needed? If it's still needed, shouldn't the note/comment still be present?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmonr It was needed, but the wait_us comment was removed inadvertently. In the immediately following commit ccec9d7, all wait_us comments are moved to the front:

/* NOTE: When system clock is higher than timer clock, we need to add 3 engine clock
 *       (recommended by designer) delay to wait for above timer control to take effect. */

TIMER_Start(timer_base);
}

void lp_ticker_disable_interrupt(void)
Expand Down
3 changes: 0 additions & 3 deletions targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK;
cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX);
timer_base->CMP = cmp_timer;

/* NOTE: When engine is clocked by low power clock source (LXT/LIRC), we need to wait for 3 engine clocks. */
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
TIMER_Start(timer_base);
}

void lp_ticker_disable_interrupt(void)
Expand Down
3 changes: 0 additions & 3 deletions targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK;
cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX);
timer_base->CMPR = cmp_timer;

/* NOTE: When engine is clocked by low power clock source (LXT/LIRC), we need to wait for 3 engine clocks. */
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
TIMER_Start(timer_base);
}

void lp_ticker_disable_interrupt(void)
Expand Down
3 changes: 0 additions & 3 deletions targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ void lp_ticker_set_interrupt(timestamp_t timestamp)
uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK;
cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX);
timer_base->CMP = cmp_timer;

/* NOTE: When engine is clocked by low power clock source (LXT/LIRC), we need to wait for 3 engine clocks. */
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
TIMER_Start(timer_base);
}

void lp_ticker_disable_interrupt(void)
Expand Down