<re_irc>
<thebox> Does Rust need libc/libm present when using no-std?
<re_irc>
< (@jamesmunns:beeper.com)> If you do certain floating point operations, you'll need "libm", or a "diet" alternative like micromath (https://docs.rs/micromath/latest/micromath/)
<re_irc>
< (@jamesmunns:beeper.com)> you don't generally need a "libc", unless you are linking C code that expects it
<re_irc>
<thebox> Such as trig functions?
<re_irc>
< (@jamesmunns:beeper.com)> yeah, if you get a linker error for one of those, you probably need libm
<re_irc>
<thebox> Off hand, do you know if FreeRTOS through the freertos-rust would?
<re_irc>
< (@jamesmunns:beeper.com)> Not familiar with freertos-rust, unfortunately.
<re_irc>
<thebox> Ok, thank you very much.
<re_irc>
< (@jamesmunns:beeper.com)> "fixing" the error should be as easy as adding the "libm" crate as a dependency to your cargo project, and adding "use libm as _;" in your project to ensure it gets linked in.
faern has quit [Ping timeout: 260 seconds]
bjc has joined #rust-embedded
bjc has quit [Read error: Connection reset by peer]
genpaku has quit [Remote host closed the connection]
genpaku has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
bjc has joined #rust-embedded
radens has quit [Quit: Connection closed for inactivity]
<re_irc>
<the tab openoor (spookyvision@{github,cohost})> cordic is mostly useful when no fpu
<re_irc>
<the tab openoor (spookyvision@{github,cohost})> but yeah when using FreeRTOS probably better to just link libm
<re_irc>
< (@ryan-summers:matrix.org)> FYI, https://github.com/quartiq/idsp can be used for some trig functions in a faster manner than hardware cordic with some small tradeoffs :)
<re_irc>
< (@adamgreig:matrix.org)> Hi all, just a quick note that neither I nor therealprof are able to run a meeting this week so we'll postpone to next week, and then probably the usual 2 week break after that one
<re_irc>
< (@adamgreig:matrix.org)> Hope you all have a lovely evening!
<re_irc>
< (@adamgreig:matrix.org)> Feel free to chat about embedded rust without me though :p
<re_irc>
< (@dirbaio:matrix.org)> guess critical-section will stay unyanked until 2023 then :D
<re_irc>
<the tab openoor (spookyvision@{github,cohost})> : ooh nice one
<re_irc>
< (@ryan-summers:matrix.org)> You can get about ~40 cycle sin/cos with it. We use it in some high-throughput DSP routines. There's a slight tradeoff in quanitization/precision I believe, but the error is exceptionally small
<re_irc>
< (@sourcebox:matrix.org)> : I did something similar for tan() some time ago. Initially, I thought, a const fn could be used for the LUT, but that does not work for f32s. So I ended up using a Python script to generate the table. There's surely a better approach to this.
<re_irc>
< (@jamesmunns:beeper.com)> Yeah, I used a little snippet of Rust code to generate the data. You could (today) use a build rs script to generate the data, but honestly I've just copy and pasted the code depending on the tweaks I've needed.
IlPalazzo-ojiisa has quit [Quit: Leaving.]
dc740 has quit [Remote host closed the connection]
<re_irc>
<Stephen D> the tab openoor (spookyvision@{github,cohost}): Lol thanks, that's my cat