dreamcat4 has quit [Quit: Connection closed for inactivity]
fabic has quit [Ping timeout: 240 seconds]
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 252 seconds]
fabic has joined #rust-embedded
fabic has quit [Ping timeout: 240 seconds]
Amadiro has joined #rust-embedded
dreamcat4 has joined #rust-embedded
<re_irc>
<@richarddodd:matrix.org> What's the best image format for size & decompress speed (where compression can be as slow as you like)?
<re_irc>
<@newam:matrix.org> Some ST chips have JPG acceleration if that's an option.
<re_irc>
<@newam:matrix.org> Apart from that I am not really sure, never had to optimize for those things. Let me know if you find an answer though, I'm curious
<re_irc>
<@richarddodd:matrix.org> I'm on nrf.
<re_irc>
<@richarddodd:matrix.org> Some more background: I'm drawing pixel graphics, so there is a lot of repetition in the data. Maybe an easy option is to use a palette and have 4 bits per pixel (ish) rather than the current 16.
<re_irc>
<@newam:matrix.org> GIF optimizes for large single-color areas, and is a simple format so it would be fast to decode.
<re_irc>
<@newam:matrix.org> For pixel graphics maybe GIF?
<re_irc>
<@newam:matrix.org> You _could_ also do SVG if you're doing simple shapes, that would likely win for size; rendering time would be insane though.
<re_irc>
<@richarddodd:matrix.org> totally OT, but if I was teaching anything algebraic now, I would use emoji rather than greek letters. Greek intimidates needlessly
<re_irc>
<@hargonix:matrix.org> newam: we always used U for voltage...never got why
<re_irc>
<@adamgreig:matrix.org> I thought writing greek letters was bad enough but I can't imagine having to draw all the emojis while writing equations :P
<re_irc>
<@richarddodd:matrix.org> (only emoji for lesson 1)
<re_irc>
<@come_744:converser.eu> Don't emoji look alike too much ?
<re_irc>
<@adamgreig:matrix.org> 🏃 for velocity, 🎯 for position?
<re_irc>
<@hargonix:matrix.org> we should just switch alphabets in formulas occasionally to confuse people more
<re_irc>
<@richarddodd:matrix.org> What I mean is: newcomers imbue greek letters with special meaning, when all we want is "something that represents an unknown number"
<re_irc>
<@bobmcwhirter:matrix.org> I learned y=mx+b for graphing, but my kid learned y=sx+c or somesuch weirdness.
<re_irc>
<@come_744:converser.eu> y = ax + b here
<re_irc>
<@hargonix:matrix.org> y = mx + t here
<re_irc>
<@come_744:converser.eu> And α for angles
<re_irc>
<@hargonix:matrix.org> yeah greek for angles seems to be generally agreed upon
<re_irc>
<@richarddodd:matrix.org> I'm fighting a bug and wondering, can 64KB ever mean 64 * 1000 rather than 64 * 1024?
<re_irc>
<@come_744:converser.eu> Yes if you say KiB for 1024
<re_irc>
<@richarddodd:matrix.org> Côme: that might explain a lot, thanks!
<re_irc>
<@come_744:converser.eu> ;=
<re_irc>
<@adamgreig:matrix.org> lol, y=mx+c was my childhood
<re_irc>
<@adamgreig:matrix.org> sx+c... I guess s for slope?
<re_irc>
<@adamgreig:matrix.org> makes more sense than m for gradieMt I guess
<re_irc>
<@come_744:converser.eu> m for multiplicator and c for constant ?
<re_irc>
<@dkhayes117:matrix.org> Modulus of slope
<re_irc>
<@adamgreig:matrix.org> surely if you want it to generalise you might need to go beyond 26 powers :P
<re_irc>
<@jduchniewicz:matrix.org> For me it is also the simplest haha
<re_irc>
<@adamgreig:matrix.org> I guess you'd get into trouble when you got to x * x^24 actually
<re_irc>
<@dirbaio:matrix.org> hehehe then you just say "we have a polynomial P" and gtfo
<re_irc>
<@jduchniewicz:matrix.org> The subscripts are more scientific
<re_irc>
<@dkhayes117:matrix.org> Drunk maths guy, "screw it, I'm using M for slope, yolo"
<re_irc>
<@adamgreig:matrix.org> "it's just for this one chapter, whatever, who cares"
<re_irc>
<@dirbaio:matrix.org> n, m, k sound like integers for when doing discrete maths
<re_irc>
<@dirbaio:matrix.org> using M for the slope is a crime
<re_irc>
<@dkhayes117:matrix.org> With calc though, you don't write ..+ b with derivatives, its ..+ c
fabic has quit [Ping timeout: 252 seconds]
<re_irc>
<@dirbaio:matrix.org> c for "constant"
<re_irc>
<@dirbaio:matrix.org> a for "a constant"
<re_irc>
<@dirbaio:matrix.org> y = ax + c
<re_irc>
<@dirbaio:matrix.org> gg ez
<re_irc>
<@dkhayes117:matrix.org> Maybe they should type annotate the variables instead of changing them haha
fabic has joined #rust-embedded
GenTooMan has quit [Ping timeout: 250 seconds]
GenTooMan has joined #rust-embedded
fabic has quit [Ping timeout: 240 seconds]
<re_irc>
<@firefrommoonlight:matrix.org> Im a fan of greek letter variable names when appropriate. You used to need to suppress a Rust warning about non ASCII identifiers, but they might have removed that lint
<re_irc>
<@firefrommoonlight:matrix.org> Using custom keyboard shortcuts
<re_irc>
<@adamgreig:matrix.org> on linux you can use the dead_greek dead key, e.g. for me, altgr+g then a gives α, or shift+s for Σ, etc
<re_irc>
<@adamgreig:matrix.org> just gotta remember that f is for phi... φ Φ
<re_irc>
<@hargonix:matrix.org> If you're working in emacs there is a cool built in thing you can use. you can switch your input method to Tex with set-input-method and then type stuff like \alpha \beta \gamma and emacs will automaticaly replace all TeX commands youtyped (and it knows about of course) with the proper utf-8 characters.
<re_irc>
<@adamgreig:matrix.org> also works in jupyter notebook, it's nice
<re_irc>
<@come_744:converser.eu> adamgreig: Which *sounds* logical (pun intended)
<re_irc>
<@come_744:converser.eu> adamgreig: TIL, I thought it was only a Bépo layout feature
<re_irc>
<@firefrommoonlight:matrix.org> On Windows, I use a custom keyboard layout that works in a very similar way! Didn't know it was standard in Linux
<re_irc>
<@firefrommoonlight:matrix.org> Only just right alt+key
<re_irc>
<@firefrommoonlight:matrix.org> The Tex approach is nice too, and eaiser to adopt
<re_irc>
<@firefrommoonlight:matrix.org> I haven't used Greek letters in an embedded project, but they're nice for scientific and mathematical code
<re_irc>
<@firefrommoonlight:matrix.org> Although I do use them in comments, eg measuring conductivity in micro etc
<re_irc>
<@firefrommoonlight:matrix.org> Or degrees (I'm phone typing now)
<re_irc>
<@vitaly.codes:matrix.org> Happy to be here.
<re_irc>
<@barafael:matrix.org> I want to define a simple protocol for exchanging data over a serial port. Simple structs, but should be as small as possible. Doesn't have to be super quick to parse though. Any recommendations? Is this what postcard does?
<re_irc>
<@rahix:matrix.org> barafael: Yes, postcard does exactly what you need
<re_irc>
<@newam:matrix.org> What is postcard? Tried googling a few things, didn't come up with anything but letter mail
<re_irc>
<@barafael:matrix.org> Thanks rahix , taking a look
<Lumpio->
It has built-in support for cobs framing
<Lumpio->
And for different frame types you can just have the top level type be an enum
rektide has quit [Quit: leaving]
rektide has joined #rust-embedded
rektide has quit [Quit: leaving]
rektide has joined #rust-embedded
<re_irc>
<@firefrommoonlight:matrix.org> Iirc I asked if postcard was suitable for a similar task when it was announced here recently, and was told it's not
<re_irc>
<@firefrommoonlight:matrix.org> What does the data look like?
<Lumpio->
Why'd they say it was not suitable?
<re_irc>
<@jamesmunns:matrix.org> Happy to answer any postcard questions :)
<re_irc>
<@jamesmunns:matrix.org> Iirc, I think the last time I said it wasn't suitable was when someone was trying to implement some existing protocol with postcard
<re_irc>
<@jamesmunns:matrix.org> Postcard generally expects you to have rust/postcard on both ends, or something that explicitly follows postcards wire format
<re_irc>
<@jamesmunns:matrix.org> It's not really designed to mimic other existing protocols.
<re_irc>
<@jamesmunns:matrix.org> But if someone else said it wasn't suitable, the I dunno :D
<re_irc>
<@jamesmunns:matrix.org> But assuming you have rust on both sides of the wire, either MCU to MCU, MCU to PC, or PC to PC, it should pretty much be what you want. And COBS will work if you need framing over a serial port, a TCP port, or similar
<re_irc>
<@firefrommoonlight:matrix.org> The example in question was flash memory storage, which is a conceptually similar problem (Struct in -> Byte array out)
<re_irc>
<@firefrommoonlight:matrix.org> As in, what dotcypress said: The bulk of this problem is the encoding
<re_irc>
<@firefrommoonlight:matrix.org> Unrelated: In the interest of practical examples, I just published this, which is part of a 2-unit stovetop IR thermometer. Demonstrates use of a handful of nrf-52 protocols, as well as how to structure a program that's suitable for long-term battery opteration:
<re_irc>
<@firefrommoonlight:matrix.org> Uses thalesfragoso 's ESB library, although on a custom fork due to PAC compatibility issues
<re_irc>
<@gdamjan:spodeli.org> how do you receive the data?
<re_irc>
<@firefrommoonlight:matrix.org> MLX90614 sensor. Interaction with it is in `sensor.rs`
<re_irc>
<@gdamjan:spodeli.org> no, I meant the ESB transmission
<re_irc>
<@firefrommoonlight:matrix.org> a separate unit that has a small OLED display, and the same MCU module
<re_irc>
<@firefrommoonlight:matrix.org> I can post the reception code if you'd like. It's working now on 2 dev boards, but I don't have the display set up
<re_irc>
<@firefrommoonlight:matrix.org> (Ie the receiver is just printing to console ATM and needs more testing before I publish)
<re_irc>
<@firefrommoonlight:matrix.org> Also has 2 buttons: C/F, and emissivity adjustment
<re_irc>
<@gdamjan:spodeli.org> I wonder if there's something to receive the ESB data on a PC/laptop
<re_irc>
<@firefrommoonlight:matrix.org> That would be cool. Switching to bluetooth would be one way around that. And would have the practical advantage of letting people read it on phones as well. However... I can't figure out BT at this time, and don't want to delay the project further