File tree Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Expand file tree Collapse file tree 1 file changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,7 @@ func sleepTicks(d timeUnit) {
120
120
for d != 0 {
121
121
ticks () // update timestamp
122
122
ticks := uint32 (d ) // current scaling only supports 100 usec to 6553 msec
123
- if ! timerSleep (ticks ) {
124
- return
125
- }
123
+ timerSleep (ticks )
126
124
d -= timeUnit (ticks )
127
125
}
128
126
}
@@ -143,8 +141,7 @@ func ticks() timeUnit {
143
141
}
144
142
145
143
// ticks are in microseconds
146
- // returns false if an interrupt occured
147
- func timerSleep (ticks uint32 ) bool {
144
+ func timerSleep (ticks uint32 ) {
148
145
timerWakeup .Set (0 )
149
146
150
147
// STM32 timer update event period is calculated as follows:
@@ -191,19 +188,10 @@ func timerSleep(ticks uint32) bool {
191
188
// Enable the timer.
192
189
stm32 .TIM3 .CR1 .SetBits (stm32 .TIM_CR1_CEN )
193
190
194
- wait:
195
- arm .Asm ("wfi" )
196
- if timerWakeup .Get () != 0 {
197
- return true
191
+ // wait till timer wakes up
192
+ for timerWakeup .Get () == 0 {
193
+ arm .Asm ("wfi" )
198
194
}
199
-
200
- if hasScheduler {
201
- return false
202
- } else {
203
- // keep looping until the routine exits or is interrupted
204
- goto wait
205
- }
206
-
207
195
}
208
196
209
197
func handleTIM3 (interrupt.Interrupt ) {
You can’t perform that action at this time.
0 commit comments