ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
IlPalazzo-ojiisa has quit [Quit: Leaving.]
m5zs7k has quit [Ping timeout: 255 seconds]
m5zs7k_ has joined #rust-embedded
m5zs7k_ is now known as m5zs7k
hmw has joined #rust-embedded
Socker has quit [Ping timeout: 250 seconds]
<re_irc> A "short" video in which I bang on about Embedded Rust and the wonders of the community and our portable drivers.
Socker has joined #rust-embedded
Socker has quit [Ping timeout: 265 seconds]
Socker has joined #rust-embedded
Dr_Who has joined #rust-embedded
Socker has quit [Ping timeout: 252 seconds]
Socker has joined #rust-embedded
Socker has quit [Ping timeout: 255 seconds]
Socker has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
Socker has quit [Ping timeout: 240 seconds]
Socker has joined #rust-embedded
Foxyloxy_ has joined #rust-embedded
Foxyloxy has quit [Ping timeout: 265 seconds]
Dr_Who has quit [Quit: ZZZzzz…]
Socker has quit [Ping timeout: 240 seconds]
Socker has joined #rust-embedded
Socker has quit [Ping timeout: 240 seconds]
Socker has joined #rust-embedded
<re_irc> <@imdoor:ilgt.lv> hi, how should i go about using the "PwmPin" trait from "embedded-hal" (v0.2.7) if i want the duty cycle be some fraction of the maximum (as returned by "get_max_duty()")? e.g., i want to be able to say stuff like
<re_irc> fn set_pwm_duty<P>(pwm_pin: &mut P)
<re_irc> P: PwmPin,
<re_irc> where
<re_irc> // How do i achieve this? This won't work without some
<re_irc> {
<re_irc> // extra constraints on the PwmPin::Duty associated type
<re_irc> let new_duty = pwm_pin.get_max_duty() * 3 / 256;
<re_irc> pwm_pin.set_duty(new_duty);
<re_irc> }
<re_irc> <@imdoor:ilgt.lv> but how to do it safely? i guess i could require that "P::Duty: From<u8>, P::Duty: Div, P::Duty: Mul" or something, but that doesn't guarantee that i won't end up with overflows, i.e.,:
<re_irc> fn set_pwm_duty<P>(pwm_pin: &mut P)
<re_irc> where
<re_irc> P::Duty: Div,
<re_irc> P: PwmPin,
<re_irc> P::Duty: Mul,
<re_irc> P::Duty: From<u8>,
<re_irc> {
<re_irc> let three = P::Duty::from(3_u8);
<re_irc> let other = P::Duty::from(255_u8);
<re_irc> // This might overflow
<re_irc> let new_duty = pwm_pin.get_max_duty() * three / other;
<re_irc> pwm_pin.set_duty(new_duty);
<re_irc> }
<re_irc> <@vollbrecht:matrix.org> because it is not independent of the concrete pwm implementation this is not simply general usable.
<re_irc> /// Type for the `duty` methods
<re_irc> ///
<re_irc> /// The implementer is free to choose a float / percentage representation
<re_irc> /// (e.g. `0.0 .. 1.0`) or an integer representation (e.g. `0 .. 65535`)
<re_irc> type Duty;
<re_irc> so one hal implementer may implement the float variant while one other may implement it as an u32
<re_irc> i think thats why this was axed and is now changed in the embedde-hal alpha releases.
<re_irc> <@imdoor:ilgt.lv> that makes sense, i guess. i did notice that the existing pwm stuff is gone from the 1.0 alpha
<re_irc> <@vollbrecht:matrix.org> its back inside the alpha.10 release
<re_irc> <@vollbrecht:matrix.org> so depending on your platform some hal may implement it already
<re_irc> <@imdoor:ilgt.lv> vollbrecht: yeah, the new trait looks much more usable
<re_irc> i'll have to check if the boards platforms i'm interested in support the new traits. thanks!
<re_irc> <@imdoor:ilgt.lv> -boards
IlPalazzo-ojiisa has joined #rust-embedded
<re_irc> <@ia0:matrix.org> Hi! Is this the right chat to ask the procedure to get a PR reviewed? https://github.com/rust-embedded-community/usb-device/pull/115
<re_irc> <@jamesmunns:beeper.com> This is probably the right place!
<re_irc> <@ryan-summers:matrix.org> ia0: I'm on vacation, but can review it later this week. :) Also check out Rust + USB™ = ♥
<re_irc> <@xiretza:xiretza.xyz> #usb-rs:matrix.org (https://matrix.to/#/#usb-rs:matrix.org) ^
emerent has quit [Ping timeout: 265 seconds]
Socker has quit [Ping timeout: 255 seconds]
emerent has joined #rust-embedded
<re_irc> <@ia0:matrix.org> : No worries, thanks!
Socker has joined #rust-embedded
Socker has quit [Ping timeout: 240 seconds]
lehmrob has joined #rust-embedded
Socker has joined #rust-embedded
<re_irc> <@dirbaio:matrix.org> oh boi the riscv atomics issue
<re_irc> <@shakencodes:matrix.org> I am working with stm32wlxx-hal (with the defmt dependency popped up to 0.3.4, fixing a defmt wire format version issue) and am attempting to run the testsuite and am getting the following error:
<re_irc> "Error: failed to demangle defmt symbol "{"package":"testsuite","tag":"defmt_debug","data":"I2C2 ISR={:#08X}","disambiguator":"362709172824667103"}": missing field "crate_name" at line 1 column 106"
<re_irc> I do not find "crate_name" anywhere in the stm32wlxx-hal crate and am not sure where to start to make this work. Any suggestions?
<re_irc> <@jamesmunns:beeper.com> that looks like the the defmt wire format issue. What does "probe-run -V" say?
<re_irc> <@jamesmunns:beeper.com> (the answer is you probably need to update probe-run or downgrade your defmt dependency, I can't remember what the "blessed" compatible versions are off the top of my head. ^ )
<re_irc> <@jamesmunns:beeper.com> https://github.com/knurling-rs/probe-run/issues/392 seems like the relevant issue
<re_irc> <@tschundler:matrix.org> Someone at work shared https://purdue.ca1.qualtrics.com/jfe/form/SV_3EPvSqpOnoPMX7U - survey on Rust for Embedded from purdue.edu - maybe relevant to those here too.
<re_irc> <@shakencodes:matrix.org> $ probe-run -V
<re_irc> 0.3.8
<re_irc> supported defmt version: 4
<re_irc> $
GenTooMan has quit [Ping timeout: 260 seconds]
GenTooMan has joined #rust-embedded
<re_irc> <@shakencodes:matrix.org> : Yes, this looks like the exact same thing. I am going to try to install the older version of probe-run to see it that will work around the problem today.
<re_irc> <@shakencodes:matrix.org> ... which worked. Thank you, James!
<re_irc> <@yatekii:matrix.org> Has anyone here ever built a https://github.com/Ottercast/OtterCastAudioV2 fucking epic!?
<re_irc> <@peter9477:matrix.org> : Full circle. :-) The source shared this above just a bit earlier today (?): https://matrix.to/#/!BHcierreUuwCMxVqOf:matrix.org/$vSWzAjM2inDVpm936gPu-N9TRZQcvrFpXTK3HV-g8k8?via=matrix.org&via=psion.agg.io&via=tchncs.de
<re_irc> <@tschundler:matrix.org> : 😅 oops, didn't scroll back far enough
lehmrob has quit [Ping timeout: 265 seconds]
Bizzike has joined #rust-embedded
Bizzike has quit [Client Quit]