Skip to content

Commit 52c3904

Browse files
ccli8adbridge
authored andcommitted
Fix lp_ticker_free cannot pass speed test
1 parent e2ca5f1 commit 52c3904

File tree

5 files changed

+0
-80
lines changed

5 files changed

+0
-80
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/lp_ticker.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,23 +160,7 @@ void lp_ticker_init(void)
160160

161161
void lp_ticker_free(void)
162162
{
163-
TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname);
164-
165-
/* Stop counting */
166-
TIMER_Stop(timer_base);
167-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
168-
169-
/* Wait for timer to stop counting and unset active flag */
170-
while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk));
171-
172-
/* Disable wakeup */
173-
TIMER_DisableWakeup(timer_base);
174-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
175-
176163
/* Disable interrupt */
177-
TIMER_DisableInt(timer_base);
178-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
179-
180164
NVIC_DisableIRQ(TIMER_MODINIT.irq_n);
181165

182166
/* Disable IP clock

targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,7 @@ void lp_ticker_init(void)
126126

127127
void lp_ticker_free(void)
128128
{
129-
TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname);
130-
131-
/* Stop counting */
132-
TIMER_Stop(timer_base);
133-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
134-
135-
/* Wait for timer to stop counting and unset active flag */
136-
while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk));
137-
138-
/* Disable wakeup */
139-
TIMER_DisableWakeup(timer_base);
140-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
141-
142129
/* Disable interrupt */
143-
TIMER_DisableInt(timer_base);
144-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
145-
146130
NVIC_DisableIRQ(TIMER_MODINIT.irq_n);
147131

148132
/* Disable IP clock */

targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -126,23 +126,7 @@ void lp_ticker_init(void)
126126

127127
void lp_ticker_free(void)
128128
{
129-
TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname);
130-
131-
/* Stop counting */
132-
TIMER_Stop(timer_base);
133-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
134-
135-
/* Wait for timer to stop counting and unset active flag */
136-
while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk));
137-
138-
/* Disable wakeup */
139-
TIMER_DisableWakeup(timer_base);
140-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
141-
142129
/* Disable interrupt */
143-
TIMER_DisableInt(timer_base);
144-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
145-
146130
NVIC_DisableIRQ(TIMER_MODINIT.irq_n);
147131

148132
/* Disable IP clock */

targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,7 @@ void lp_ticker_init(void)
130130

131131
void lp_ticker_free(void)
132132
{
133-
TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname);
134-
135-
/* Stop counting */
136-
TIMER_Stop(timer_base);
137-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
138-
139-
/* Wait for timer to stop counting and unset active flag */
140-
while((timer_base->CTL & TIMER_CTL_TMR_ACT_Msk));
141-
142-
/* Disable wakeup */
143-
TIMER_DisableWakeup(timer_base);
144-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
145-
146133
/* Disable interrupt */
147-
TIMER_DisableInt(timer_base);
148-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
149-
150134
NVIC_DisableIRQ(TIMER_MODINIT.irq_n);
151135

152136
/* Disable IP clock */

targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -125,23 +125,7 @@ void lp_ticker_init(void)
125125

126126
void lp_ticker_free(void)
127127
{
128-
TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname);
129-
130-
/* Stop counting */
131-
TIMER_Stop(timer_base);
132-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
133-
134-
/* Wait for timer to stop counting and unset active flag */
135-
while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk));
136-
137-
/* Disable wakeup */
138-
TIMER_DisableWakeup(timer_base);
139-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
140-
141128
/* Disable interrupt */
142-
TIMER_DisableInt(timer_base);
143-
wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3);
144-
145129
NVIC_DisableIRQ(TIMER_MODINIT.irq_n);
146130

147131
/* Disable IP clock */

0 commit comments

Comments
 (0)