Skip to content

Commit 65782d2

Browse files
committed
Fix kitchen_sink to complete with aon_timer
The aon_timer test had an infinite while loop
1 parent 62cb6e9 commit 65782d2

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

test/kitchen_sink/kitchen_sink.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ void svc_call(void) {
7272
exit(0);
7373
}
7474

75+
#if LIB_PICO_AON_TIMER
76+
static bool aon_timer_done = false;
77+
void spoop(void) {
78+
printf("XXXX YARGLE XXXX\n");
79+
aon_timer_done = true;
80+
}
81+
#endif
82+
7583
int main(void) {
7684
spiggle();
7785

@@ -137,15 +145,14 @@ int main(void) {
137145
#endif
138146
#if LIB_PICO_AON_TIMER
139147
aon_timer_start_with_timeofday();
140-
void spoop(void);
141148
struct timespec ts;
142-
ts.tv_sec = 6;
149+
ts.tv_sec = 2;
143150
ts.tv_nsec = 1000000000 / 2;
144151
aon_timer_enable_alarm(&ts, spoop, false);
145-
while (true) {
152+
while (!aon_timer_done) {
146153
aon_timer_get_time(&ts);
147154
printf("%ld %ld\n", (long)ts.tv_sec, ts.tv_nsec);
148-
busy_wait_ms(4000);
155+
busy_wait_ms(500);
149156
}
150157
#endif
151158
#ifndef __riscv
@@ -156,9 +163,3 @@ int main(void) {
156163
puts("PASSED");
157164
#endif
158165
}
159-
160-
#if LIB_PICO_AON_TIMER
161-
void spoop(void) {
162-
printf("XXXX YARGLE XXXX\n");
163-
}
164-
#endif

0 commit comments

Comments
 (0)