Commit 019afa9 1 parent 9707b7e commit 019afa9 Copy full SHA for 019afa9
File tree 2 files changed +38
-29
lines changed
microbit/src/05-led-roulette
2 files changed +38
-29
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,13 @@ fn main() -> ! {
21
21
rtt_init_print ! ( ) ;
22
22
23
23
let board = Board :: take ( ) . unwrap ( ) ;
24
+
24
25
let mut timer = Timer :: new ( board. TIMER0 ) ;
25
26
let mut display = Display :: new ( board. display_pins ) ;
27
+
28
+ // Setup the display delay so the math works as expected later.
29
+ display. set_delay_ms ( 1 ) ;
30
+
26
31
let mut leds = [
27
32
[ 0 , 0 , 0 , 0 , 0 ] ,
28
33
[ 0 , 0 , 0 , 0 , 0 ] ,
@@ -37,7 +42,9 @@ fn main() -> ! {
37
42
for current_led in PIXELS . iter ( ) {
38
43
leds[ last_led. 0 ] [ last_led. 1 ] = 0 ;
39
44
leds[ current_led. 0 ] [ current_led. 1 ] = 1 ;
45
+
40
46
display. show ( & mut timer, leds, 30 ) ;
47
+
41
48
last_led = * current_led;
42
49
}
43
50
}
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ $ cargo embed --features v1 --target thumbv6m-none-eabi --release
21
21
(...)
22
22
```
23
23
24
- If you want to debug your "release" mode binary you'll have to use a different GDB command:
24
+ If you want to debug your "release" mode binary you'll have to use a different GDB command to load the other binary :
25
25
26
26
``` console
27
27
# For micro:bit v2
@@ -41,49 +41,51 @@ $ cargo size --features v2 --target thumbv7em-none-eabihf -- -A
41
41
led-roulette :
42
42
section size addr
43
43
.vector_table 256 0x0
44
- .text 26984 0x100
45
- .rodata 2732 0x6a68
44
+ .text 33564 0x100
45
+ .rodata 4824 0x6a68
46
46
.data 0 0x20000000
47
+ .gnu.sgstubs 0 ox9700
47
48
.bss 1092 0x20000000
48
49
.uninit 0 0x20000444
49
- .debug_abbrev 33941 0x0
50
- .debug_info 494113 0x0
51
- .debug_aranges 23528 0x0
52
- .debug_ranges 130824 0x0
53
- .debug_str 498781 0x0
54
- .debug_pubnames 143351 0x0
55
- .debug_pubtypes 124464 0x0
50
+ .debug_loc 5446 0x0
51
+ .debug_abbrev 22709 0x0
52
+ .debug_info 630006 0x0
53
+ .debug_aranges 22488 0x0
54
+ .debug_ranges 186616 0x0
55
+ .debug_str 726748 0x0
56
+ .comment 64 0x0
56
57
.ARM.attributes 58 0x0
57
- .debug_frame 69128 0x0
58
- .debug_line 290580 0x0
59
- .debug_loc 1449 0x0
60
- .comment 109 0x0
61
- Total 1841390
58
+ .debug_frame 71712 0x0
59
+ .debug_line 320979 0x0
60
+ .debug_pubnames 702 0x0
61
+ .debug_pubtypes 71 0x0
62
+ Total 2027335
62
63
63
64
64
65
$ cargo size --features v2 --target thumbv7em-none-eabihf --release -- -A
65
66
Finished release [optimized + debuginfo] target(s) in 0.02s
66
67
led-roulette :
67
68
section size addr
68
69
.vector_table 256 0x0
69
- .text 6332 0x100
70
- .rodata 648 0x19bc
70
+ .text 6516 0x100
71
+ .rodata 612 0x19bc
71
72
.data 0 0x20000000
73
+ .gnu.sgstubs 0 0x1ce0
72
74
.bss 1076 0x20000000
73
75
.uninit 0 0x20000434
74
- .debug_loc 9036 0x0
75
- .debug_abbrev 2754 0x0
76
- .debug_info 96460 0x0
77
- .debug_aranges 1120 0x0
78
- .debug_ranges 11520 0x0
79
- .debug_str 71325 0x0
80
- .debug_pubnames 32316 0x0
81
- .debug_pubtypes 29294 0x0
76
+ .debug_loc 10784 0x0
77
+ .debug_abbrev 3159 0x0
78
+ .debug_info 63612 0x0
79
+ .debug_aranges 1040 0x0
80
+ .debug_ranges 11576 0x0
81
+ .debug_str 69813 0x0
82
+ .comment 64 0x0
82
83
.ARM.attributes 58 0x0
83
- .debug_frame 2108 0x0
84
- .debug_line 19303 0x0
85
- .comment 109 0x0
86
- Total 283715
84
+ .debug_frame 2084 0x0
85
+ .debug_line 18180 0x0
86
+ .debug_pubnames 702 0x0
87
+ .debug_pubtypes 71 0x0
88
+ Total 189603
87
89
88
90
# micro:bit v1
89
91
$ cargo size --features v1 --target thumbv6m-none-eabi -- -A
You can’t perform that action at this time.
0 commit comments