igiona[m] has quit [Quit: Idle timeout reached: 172800s]
RockBoynton[m] has joined #rust-embedded
<RockBoynton[m]>
is there a technical reason why defmt doesn't support having the identifier within the brackets instead of as a vararg, e.g. println!("hello, {world}")?
esden[cis] has quit [Quit: Idle timeout reached: 172800s]
<thejpster[m]>
I think the problem is that - given the string "hello, {world}" and and a byte buffer containing 04 00 01 00 00 00, how are you going to render that?
<thejpster[m]>
You could I guess make the macro re-write the format string to use numbered arguments and emit the rewritten string. But basically rendering the string involves walking it, finding each arg, and then popping the appropriate number of bytes off the byte buffer.
<thejpster[m]>
(the byte buffer is 0x0004 which might be a string ID for the string {=u32}, assuming world: u32 and 0x00000001 which is a value for world as a 32-bit integer)
<thejpster[m]>
the rule is - if the format string arg has a specified type, you can pull the raw value straight from the stream, and if it doesn't, pull an interned format string ID and then do whatever that says do.
<vollbrecht[m]>
scorpion2185[m]1: in general the idea behind this trait crates is that your HAL or yourself would provide a implementation, so user code can be simpler be shared. But every architecture would need its own implementation.
<vollbrecht[m]>
* would need to provide its own
<vollbrecht[m]>
* a implementation in some library form, so, * would need to provide its own
petekubiak[m] has quit [Quit: Idle timeout reached: 172800s]