lkostka[m] has quit [Quit: Idle timeout reached: 172800s]
<PhilMarkgraf[m]>
<dirbaio[m]> "```rust..." <- What are the implications of make_static? I'm guessing you can only make ONE i2cBus2, if you use this approach. (Which is fine in my usage.)
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<dirbaio[m]>
<PhilMarkgraf[m]> "What are the implications of..." <- exactly that, yes
<dirbaio[m]>
dirbaio[m]: first time you run the `make_static!()` it'll convert to `&'static Whatever`, second time it'll panic
<ducks2788[m]>
I want to use control as argument for a spawned task, but the compiler says it does not live long enough. I also tried to make a closure, that uses control, and give the closure to my task. But that also does not work...
<dirbaio[m]>
you need to make_static! the state
<dirbaio[m]>
then you can pass `Control<'static>` to the spawned task
<ducks2788[m]>
But this doesn't work, if I try to spawn multiple tasks in a loop, because control is moved into make_static! and can be used only once?
<ducks2788[m]>
If I leave control as it is, Rust says it cannot borrow control as mutable more than once a time... Btw: Is Rust insane or crazy? 😂
emerent has quit [Ping timeout: 256 seconds]
emerent has joined #rust-embedded
<dirbaio[m]>
Ah, you didn't say you wanted to use Control from multiple tasks at the same time :)
<dirbaio[m]>
You have to wrap it in a mutex for that
<ducks2788[m]>
Which Mutex should I use embassy_sync::{sync, blocking_sync}} and how should I use it. Can you give an example, please?
<ducks2788[m]>
* Which Mutex should I use embassy_sync::{mutex, blocking_sync}::Mutex and how should I use it. Can you give an example, please?
<ducks2788[m]>
* Which Mutex should I use embassy_sync::{mutex, blocking_mutex}::Mutex and how should I use it. Can you give an example, please?
<ducks2788[m]>
Yeah, I have it! It compiles! 😂 Thank you! 👍️
notgull has quit [Ping timeout: 255 seconds]
notgull has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
lehmrob has joined #rust-embedded
starblue has quit [Ping timeout: 276 seconds]
starblue has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
lehmrob has quit [Ping timeout: 264 seconds]
azzentys117[m] has quit [Quit: Idle timeout reached: 172800s]
<StephenD[m]>
I noticed that when the stm32 is put in DFU it activates a ton of busses - USART, SPI, I2C, etc. I'm worried it may activate a pin as an output that I also happen to be driving, damaging the pin. Should I just be putting small resistors on these pins, or is there a better way? I guess I could either avoid the pins that the DFU uses (it's document) but I'm curious if there's a way to tell the chip to only activate USB when in DFU
<StephenD[m]>
mode. I didn't see anything in the docs
<StephenD[m]>
I also realize this may be a teeny bit off topic for this room, sorry 😅
<adamgreig[m]>
It always activates all those interfaces, though I thought it had all of them in a receive only mode until it received a message on it
<StephenD[m]>
Hmm, it isn't obvious to me whether or not it puts the respective GPIO into output mode immediately
korken89[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]>
There's a specific DFU app note, but I seem to recall it always cycles through listening on all of the interfaces
<JamesMunns[m]>
AN2606, looks like
<JamesMunns[m]>
It does rx-only I think, but some pins will be pulled up
<JamesMunns[m]>
Stephen D as far as I can tell, as long as you are okay with some pins being pulled high, you should be fine. Definitely look for your specific chip tho
<JamesMunns[m]>
For example in STM32F405, it pulls USART1, USART3, and CAN2 pins high, but all as inputs initially it seems
<StephenD[m]>
<JamesMunns[m]> "AN2606, looks like" <- Yeah that's the one I'm looking at
<StephenD[m]>
JamesMunns[m]: Okay thanks. That should be fine then
<StephenD[m]>
I was mainly just worried about damage
<JamesMunns[m]>
Be careful not to put any "turn on the big heater" switches on those pins :D
<StephenD[m]>
Ah true
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
kevlan[m] has quit [Quit: Idle timeout reached: 172800s]
burrbull[m] has quit [Quit: Idle timeout reached: 172800s]
mabez[m] has quit [Quit: Idle timeout reached: 172800s]
Danilo[m] has quit [Quit: Idle timeout reached: 172800s]
AdamHott[m] has quit [Quit: Idle timeout reached: 172800s]
lehmrob has joined #rust-embedded
mameluc[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has quit [Read error: Connection reset by peer]
IlPalazzo-ojiisa has joined #rust-embedded
lulf[m] has quit [Quit: Idle timeout reached: 172800s]
Ralph[m]1 has quit [Quit: Idle timeout reached: 172800s]
ian_rees[m] has quit [Quit: Idle timeout reached: 172800s]
crabbedhaloablut has quit []
lehmrob has quit [Ping timeout: 268 seconds]
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]