File tree Expand file tree Collapse file tree 2 files changed +6
-23
lines changed
targets/TARGET_NUVOTON/TARGET_M480 Expand file tree Collapse file tree 2 files changed +6
-23
lines changed Original file line number Diff line number Diff line change @@ -103,8 +103,6 @@ void lp_ticker_init(void)
103
103
104
104
// Schedule wakeup to match semantics of lp_ticker_get_compare_match()
105
105
lp_ticker_set_interrupt (wakeup_tick );
106
-
107
-
108
106
}
109
107
110
108
timestamp_t lp_ticker_read ()
@@ -144,21 +142,13 @@ timestamp_t lp_ticker_read()
144
142
145
143
void lp_ticker_set_interrupt (timestamp_t timestamp )
146
144
{
147
- uint32_t now = lp_ticker_read ();
145
+ uint32_t delta = timestamp - lp_ticker_read ();
148
146
wakeup_tick = timestamp ;
149
147
150
148
TIMER_Stop ((TIMER_T * ) NU_MODBASE (timer3_modinit .modname ));
151
149
152
- int delta = (int ) (timestamp - now );
153
- if (delta > 0 ) {
154
- cd_major_minor_clks = (uint64_t ) delta * US_PER_TICK * TMR3_CLK_PER_SEC / US_PER_SEC ;
155
- lp_ticker_arm_cd ();
156
- } else {
157
- // NOTE: With lp_ticker_fire_interrupt() introduced, upper layer would handle past event case.
158
- // This code fragment gets redundant, but it is still kept here for backward-compatible.
159
- void lp_ticker_fire_interrupt (void );
160
- lp_ticker_fire_interrupt ();
161
- }
150
+ cd_major_minor_clks = (uint64_t ) delta * US_PER_TICK * TMR3_CLK_PER_SEC / US_PER_SEC ;
151
+ lp_ticker_arm_cd ();
162
152
}
163
153
164
154
void lp_ticker_fire_interrupt (void )
Original file line number Diff line number Diff line change @@ -147,16 +147,9 @@ void us_ticker_set_interrupt(timestamp_t timestamp)
147
147
{
148
148
TIMER_Stop ((TIMER_T * ) NU_MODBASE (timer1hires_modinit .modname ));
149
149
150
- int delta = (int ) (timestamp - us_ticker_read ());
151
- if (delta > 0 ) {
152
- cd_major_minor_us = delta * US_PER_TICK ;
153
- us_ticker_arm_cd ();
154
- } else {
155
- // NOTE: With us_ticker_fire_interrupt() introduced, upper layer would handle past event case.
156
- // This code fragment gets redundant, but it is still kept here for backward-compatible.
157
- void us_ticker_fire_interrupt (void );
158
- us_ticker_fire_interrupt ();
159
- }
150
+ uint32_t delta = timestamp - us_ticker_read ();
151
+ cd_major_minor_us = delta * US_PER_TICK ;
152
+ us_ticker_arm_cd ();
160
153
}
161
154
162
155
void us_ticker_fire_interrupt (void )
You can’t perform that action at this time.
0 commit comments