<i509vcb[m]>
I hacked up a "blinky using postcard over usb" example as well with the new embedded_hal_async::digital::OutputPin trait.
<i509vcb[m]>
James Munns if you want to see it "hacked together in 2 hours" https://github.com/i509VCB/postcard-gpio-test/tree/master (I want to do something different here than having to declare each endpoint manually, but thats a different topic than the new traits)
<i509vcb[m]>
I was curious and scope to it. With the overhead of usb transport I was getting a blink period (on then off) of 2.007 seconds (7ms overhead from USB).
<i509vcb[m]>
* from USB per blink).
<i509vcb[m]>
* curious and connected scope to, * from USB per blink).
<i509vcb[m]>
The host in question is a Linux PC so 7ms isn't an unrealistic amount of time
<thejpster[m]>
I'm pretty sure this is exactly what core::ptr::addr_of_mut! was designed for, but opinions on general sound-ness welcome.
<dirbaio[m]>
yeah that is sound afaik
<dirbaio[m]>
i'm amused at your insistence of using structs for layout though :D
<dirbaio[m]>
s/of/in/
<danielb[m]>
<dirbaio[m]> "i'm amused at your insistence of..." <- yeah that's going to be fun to use when the registers are striped like CONF0, CONF1, CTRL0, CTRL1
<bogdan[m]>
<thejpster[m]> "ok fine, I shaved the yak..." <- Does `rust fn read_data(&mut self) -> u32` _need_ `&mut`, or is it just a typo? Is it an _aliasing_ thing?
<bogdan[m]>
s/rust//
<thejpster[m]>
&self is probably fine for reads?
<thejpster[m]>
These handles aren’t singletons - they are just unsafe to create.
<thejpster[m]>
I do listen to dirbaio, sometimes! lol
<thejpster[m]>
So you can race on a modify call if you make two of them, even though each has ‘exclusive’ access. Unsure if I should just make modify take & self or not.
cinemaSundays has joined #rust-embedded
cinemaSundays has quit [Quit: Connection closed for inactivity]