File tree Expand file tree Collapse file tree 2 files changed +38
-29
lines changed
microbit/src/05-led-roulette Expand file tree Collapse file tree 2 files changed +38
-29
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,13 @@ fn main() -> ! {
2121 rtt_init_print ! ( ) ;
2222
2323 let board = Board :: take ( ) . unwrap ( ) ;
24+
2425 let mut timer = Timer :: new ( board. TIMER0 ) ;
2526 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+
2631 let mut leds = [
2732 [ 0 , 0 , 0 , 0 , 0 ] ,
2833 [ 0 , 0 , 0 , 0 , 0 ] ,
@@ -37,7 +42,9 @@ fn main() -> ! {
3742 for current_led in PIXELS . iter ( ) {
3843 leds[ last_led. 0 ] [ last_led. 1 ] = 0 ;
3944 leds[ current_led. 0 ] [ current_led. 1 ] = 1 ;
45+
4046 display. show ( & mut timer, leds, 30 ) ;
47+
4148 last_led = * current_led;
4249 }
4350 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ $ cargo embed --features v1 --target thumbv6m-none-eabi --release
2121 (...)
2222```
2323
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 :
2525
2626``` console
2727# For micro:bit v2
@@ -41,49 +41,51 @@ $ cargo size --features v2 --target thumbv7em-none-eabihf -- -A
4141led-roulette :
4242section size addr
4343.vector_table 256 0x0
44- .text 26984 0x100
45- .rodata 2732 0x6a68
44+ .text 33564 0x100
45+ .rodata 4824 0x6a68
4646.data 0 0x20000000
47+ .gnu.sgstubs 0 ox9700
4748.bss 1092 0x20000000
4849.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
5657.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
6263
6364
6465$ cargo size --features v2 --target thumbv7em-none-eabihf --release -- -A
6566 Finished release [optimized + debuginfo] target(s) in 0.02s
6667led-roulette :
6768section size addr
6869.vector_table 256 0x0
69- .text 6332 0x100
70- .rodata 648 0x19bc
70+ .text 6516 0x100
71+ .rodata 612 0x19bc
7172.data 0 0x20000000
73+ .gnu.sgstubs 0 0x1ce0
7274.bss 1076 0x20000000
7375.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
8283.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
8789
8890# micro:bit v1
8991$ cargo size --features v1 --target thumbv6m-none-eabi -- -A
You can’t perform that action at this time.
0 commit comments