emerent has quit [Remote host closed the connection]
emerent has joined #rust-embedded
starblue has quit [Ping timeout: 260 seconds]
starblue has joined #rust-embedded
SanchayanMaity has quit [Ping timeout: 264 seconds]
edm has quit [Ping timeout: 268 seconds]
dreamcat4 has quit [Ping timeout: 268 seconds]
SanchayanMaity has joined #rust-embedded
dreamcat4 has joined #rust-embedded
edm has joined #rust-embedded
fabic has joined #rust-embedded
edm has quit [Ping timeout: 244 seconds]
SanchayanMaity has quit [Ping timeout: 256 seconds]
nohit has quit [Ping timeout: 268 seconds]
nohit has joined #rust-embedded
edm has joined #rust-embedded
SanchayanMaity has joined #rust-embedded
PyroPeter has quit [Ping timeout: 260 seconds]
PyroPeter has joined #rust-embedded
<re_irc> <@sajattack:matrix.org> newam:matrix.org: Car no do that, car go road
tokomak has joined #rust-embedded
vancz has quit [*.net *.split]
vancz has joined #rust-embedded
Foxyloxy has quit [*.net *.split]
Foxyloxy has joined #rust-embedded
<re_irc> <@henrik_alser:matrix.org> dbrgn:matrix.coredump.ch: Morning! Yeah do so! What device is it?
<re_irc> <@henrik_alser:matrix.org> May wanna check the errata of the part for any i2c issues
<re_irc> <@henrik_alser:matrix.org> You could try inserting a delay between enabling the peripheral clock and before writing and see if there’s a difference
<re_irc> <@henrik_alser:matrix.org> I think i’ve seen issues in the past with some part in the f4 family where you had to insert a delay between reseting and re-enabling the clock, don’t know if the hal does this already? (This was before my rust days)
<re_irc> <@henrik_alser:matrix.org> Using stm32f4xx-hal with pin typestates right? So you know the pins are in the right configuration?
<re_irc> <@dbrgn:matrix.coredump.ch> henrik_alser: it's a MiniF4 devboard ("black pill") with a RTC module. I'll hook up the scope tonight. Thanks for the suggestions!
<re_irc> <@henrik_alser:matrix.org> 401 or 411 version?
<re_irc> <@henrik_alser:matrix.org> I’ve seen no issues with the 411 one
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
tokomak has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
fabic has quit [Ping timeout: 256 seconds]
<re_irc> <@jordens:matrix.org> Is there something (example code, macro) that asserts that an `unwrap()` on an infallible Result actually gets optimized away? Maybe using a linker trick? Like a compile-time `unwrap()` that asserts both infallibility and does not generate any unwrap bloat.
<re_irc> <@henrik_alser:matrix.org> jordens: How about `.unwrap_or_else(|| unsafe { core::hint::unreachable_unchecked() })`
<re_irc> <@adamgreig:matrix.org> maybe https://github.com/dtolnay/no-panic ?
fabic has joined #rust-embedded
<re_irc> <@adamgreig:matrix.org> there's panic-never for crate-wide guarantee but it's quite hard to meet
<re_irc> <@rahix:matrix.org> jordens: the `void` crate kind of does this, if I understand you correctly?
<re_irc> <@rahix:matrix.org> if the `E` type of the result is uninhabited, no match arm for it can ever be code-gen'd.
<re_irc> <@jordens:matrix.org> Thanks all. Lots of good options!
<re_irc> <@jordens:matrix.org> henrik_alser:matrix.org: Ack. But that's only the optimization part. Whether it is in fact unreachable remains `unchecked`.
<re_irc> <@henrik_alser:matrix.org> Ahh sorry i misunderstood your question :)
<re_irc> <@korken89:matrix.org> jordens:matrix.org: If you use a nightly compiler you can use the following flags to remove all panics `-Zbuild-std=core, -Zbuild-std-features=panic_immediate_abort`
<re_irc> <@rahix:matrix.org> well, but this does not assert whether unwraps are infallible. it just makes them use less space in the binary (at the expense of not being able to catch any panic at all)
<re_irc> <@wim:dewith.io> Couldn't you use `unreachable_unchecked!()`?
troth has joined #rust-embedded
fabic has quit [Ping timeout: 244 seconds]
troth has quit [Ping timeout: 244 seconds]
creich has quit [Remote host closed the connection]
creich has joined #rust-embedded
<re_irc> <@qthree:matrix.org> rahix: Hello, I'm trying to use avr-hal and it looks like #[derive(PartialEq)] produces miscompilation when applied to struct with const-generics and array inside.
<re_irc> <@qthree:matrix.org> #[derive(PartialEq)]
<re_irc> <@qthree:matrix.org> fn main() -> ! {
<re_irc> <@qthree:matrix.org> struct Foo<const BAR: usize>([bool; BAR]);
<re_irc> <@qthree:matrix.org> let dp = arduino_hal::Peripherals::take().unwrap();
<re_irc> <@qthree:matrix.org> Console /dev/ttyUSB0 at 57600 baud
<re_irc> <@qthree:matrix.org> Ooops!
<re_irc> <@qthree:matrix.org> Hello World!
<re_irc> <@qthree:matrix.org> impl<const BAR: usize> core::cmp::PartialEq for Foo<BAR> {
<re_irc> <@qthree:matrix.org> self.0.iter()
<re_irc> <@qthree:matrix.org> Manual implementation works fine
<re_irc> <@qthree:matrix.org> fn eq(&self, other: &Self) -> bool {
fabic has joined #rust-embedded
<re_irc> <@rahix:matrix.org> qthree: please post this to #avr-rust_Lobby:gitter.im , that's where you'll find the right people for rust on avr :)
troth has joined #rust-embedded
fabic has quit [Ping timeout: 250 seconds]
fabic has joined #rust-embedded
<re_irc> <@emilgardis:matrix.org> can I get someone to r+ https://github.com/rust-embedded/cross/pull/602 :)
fabic has quit [Ping timeout: 240 seconds]
<re_irc> <@gauteh:matrix.org> Hi, I'm trying to get an RTC alarm to work with firing an interrupt every second. Trying to debug this I put panic! in the interrupt handler, this should halt everything right? I have an `wfi`, but once I enable the alarm it just keeps spinning. If I don't enable the specific interrupt in NVIC nothing happens. So now I wonder if the interrupt is hooked up at all..
derefnull has quit [Read error: Connection reset by peer]
<re_irc> <@jamwaffles:matrix.org> Are you clearing the interrupt flag in the handler? The interrupt will keep firing forever if you don't
<re_irc> <@gauteh:matrix.org> jamwaffles: yes, tha
<re_irc> <@jamwaffles:matrix.org> Hm, not sure then :/. Have you got some code you could paste in?
emerent_ has joined #rust-embedded
emerent has quit [Killed (iridium.libera.chat (Nickname regained by services))]
emerent_ is now known as emerent
<re_irc> <@firefrommoonlight:matrix.org> What MCU?
<re_irc> <@firefrommoonlight:matrix.org> Note that on Stm32, it's the wakeup timer you're looking for. Alarm is something different