File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,11 @@ uint get_core_num();
148148
149149static inline uint __get_current_exception (void ) {
150150 return 0 ;
151+
151152}
153+
154+ void busy_wait_at_least_cycles (uint32_t minimum_cycles );
155+
152156#ifdef __cplusplus
153157}
154158#endif
Original file line number Diff line number Diff line change 77#include <stdio.h>
88
99#include "pico.h"
10+ #include "hardware/timer.h"
1011
1112PICO_WEAK_FUNCTION_DEF (tight_loop_contents )
12-
1313void PICO_WEAK_FUNCTION_IMPL_NAME (tight_loop_contents )() {
1414
1515}
@@ -45,4 +45,10 @@ void __breakpoint() {
4545 #else
4646 __builtin_trap ();
4747 #endif
48- }
48+ }
49+
50+ PICO_WEAK_FUNCTION_DEF (busy_wait_at_least_cycles )
51+ void PICO_WEAK_FUNCTION_IMPL_NAME (busy_wait_at_least_cycles )(uint32_t cycles ) {
52+ // fairly arbitrary; we'll use 125Mhz as a reference
53+ busy_wait_us ((cycles + 124 )/125 );
54+ }
You can’t perform that action at this time.
0 commit comments