-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump rp2040-hal to 0.10.0 and embedded-hal to 1.0 #60
Conversation
boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs
Outdated
Show resolved
Hide resolved
Bumped ws2812-pio to 0.8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR !!!
I'd only request one change (but of course repeated for so many boards :o).
boards/adafruit-feather-rp2040/examples/adafruit_feather_neopixel_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/pimoroni-servo2040/examples/pimoroni_servo2040_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/adafruit-metro-rp2040/examples/adafruit_metro_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/solderparty-rp2040-stamp/examples/solderparty_stamp_neopixel_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/sparkfun-pro-micro-rp2040/examples/sparkfun_pro_micro_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/sparkfun-thing-plus-rp2040/examples/sparkfun_thing_plus_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/vcc-gnd-yd-rp2040/examples/yd_rp2040_neopixel_rainbow.rs
Outdated
Show resolved
Hide resolved
boards/waveshare-rp2040-zero/examples/waveshare_rp2040_zero_neopixel_rainbow.rs
Outdated
Show resolved
Hide resolved
c42bbdf
to
5a06d24
Compare
@ithinuel I have made the changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last bit is a little nit, sorry I missed that in your previous iteration.
@@ -66,12 +64,12 @@ fn main() -> ! { | |||
); | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mut
can be placed on the first binding :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I change let timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks);
to let mut timer = Timer::new(pac.TIMER, &mut pac.RESETS, &clocks);
Then compiler complains with the following error:
error[E0502]: cannot borrow `timer` as mutable because it is also borrowed as immutable
--> boards/adafruit-itsy-bitsy-rp2040/examples/adafruit_itsy_bitsy_rainbow.rs:72:9
|
63 | timer.count_down(),
| ----- immutable borrow occurs here
...
69 | ws.write(brightness(once(wheel(n)), 32)).unwrap();
| -- immutable borrow later used here
...
72 | timer.delay_ms(25);
| ^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I see. It might be worth adding a note that the "rebind" is to force a copy of the timer.
Or maybe change 63 | timer.count_down(),
to 63 | timer.clone().count_down(),
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timer.clone().count_down()
fails with an error creates a temporary value which is freed while still in use
, so I added a note
@@ -80,12 +78,12 @@ fn main() -> ! { | |||
// Infinite colour wheel loop | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -62,12 +60,12 @@ fn main() -> ! { | |||
); | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -66,12 +64,12 @@ fn main() -> ! { | |||
); | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -80,12 +78,12 @@ fn main() -> ! { | |||
// Infinite colour wheel loop | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -67,12 +65,12 @@ fn main() -> ! { | |||
|
|||
// Infinite colour wheel loop | |||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -79,12 +77,12 @@ fn main() -> ! { | |||
// Infinite colour wheel loop | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -78,12 +76,12 @@ fn main() -> ! { | |||
// Infinite colour wheel loop | |||
|
|||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -67,12 +65,12 @@ fn main() -> ! { | |||
|
|||
// Infinite colour wheel loop | |||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -67,12 +65,12 @@ fn main() -> ! { | |||
|
|||
// Infinite colour wheel loop | |||
let mut n: u8 = 128; | |||
let mut timer = timer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
I think we need to set MSRV to 1.75, that's also what rp2040-hal uses. |
Should I do this as part of this PR or this will be dealt separately? I guess the toolchain version should be aligned in this block
rp2040-hal ?
|
I think it would be easiest to change it in this PR, otherwise you'd have to rebase this PR to get the pipeline fixed.
Yes, replacing |
I tested GitHub action on my fork and had to adjust dependencies for |
Looks good! Thank you for the patience to address all our comments. This is a huge step forward towards BSP releases based on rp2040-hal 0.10.0. |
Depends on unreleased version of ws2812-pio with rp2040-hal 0.10.0 support