Add SFP fibers support for satman #217
No reviewers
Labels
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: M-Labs/artiq-zynq#217
Loading…
Reference in New Issue
No description provided.
Delete Branch "esavkin/artiq-zynq:213-satman-sfp-fiber-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make io_expander and i2c wrapper code shared by moving it from runtime to libboard_artiq.
Closes #213
Needs to be merged to release-7 branch.
Why was the busno parameter removed? Again please keep this PR and the refactoring to one thing. The changes like i2c.write -> i2c::write, while perhaps not incorrect unlike the busno change, do not belong here.
I suspect you have not tested this properly on runtime. https://github.com/m-labs/artiq/blob/master/artiq/coredevice/i2c.py
I see, I didn't expect external API for this. I'll move the i2c wrapper back and untie the io_expander from wrapper
The fact that it raises exceptions should have made alarm bells go off. Normally there are no exceptions in Rust.
@ -134,2 +119,2 @@
io_expander0.service().unwrap();
io_expander1.service().unwrap();
let i2c = unsafe { (&mut i2c::I2C_BUS).as_mut().unwrap() };
for i_i2c in 0..2 {
expander_index
,expander_i
or justi
fe1be9e272
to394e2b2354
@ -452,0 +452,4 @@
#[cfg(feature = "target_kasli_soc")]
{
for expander_i in &[0u8, 1] {
let mut io_expander = io_expander::IoExpander::new(&mut i2c, *expander_i).unwrap();
I doubt the & and * are necessary here.
& makes a slice from array (to make it iterable)
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6f1f8688caff98619cc0d08dd6d99a27
https://github.com/rust-lang/rust/issues/84837
Doesn't seem relevant to this case?
Maybe the link is not really relevant, but the compiler output is
Seems to be a peculiar issue with the particular compiler version we use here. What was the problem with 0..2 that you had written earlier?
0..2 may seem be confusing, because only 0 and 1 are used, from my point of view
You can expect developers to know range boundaries.
There's also the
0..=1
syntax...@ -142,3 +136,3 @@
}
};
...
Maybe leave it as it is now? IDE does such things all the time
Then reconfigure or change your IDE.
Or run a whitespace cleanup on the entire codebase in a separate PR.
Maybe integrate some standard tool for formatting files with appropriate config in the future?
Sure, if you find something that's easy to integrate, easy to enforce (e.g. git commit hook?), works well, and isn't proprietary.
For example https://github.com/rust-lang/rustfmt
394e2b2354
to8822f2493e