We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3dd38b7 commit 81615adCopy full SHA for 81615ad
board/libc.h
@@ -1,8 +1,10 @@
1
// **** libc ****
2
3
-void delay(uint32_t a) {
+__attribute__((aligned(32), noinline)) void delay(uint32_t a) {
4
+ // loop is 2.6x faster when 32-byte aligned (ART accelerator prefetches flash in 32-byte chunks)
5
volatile uint32_t i;
- for (i = 0; i < a; i++);
6
+ uint32_t n = a * 13U / 5U;
7
+ for (i = 0; i < n; i++) {}
8
}
9
10
void assert_fatal(bool condition, const char *msg) {
0 commit comments