<_whitenotifier-5>
[glasgow] DurandA commented on issue #274: Invalid glasgow_config after flashing a modified firmware - https://git.io/JY8MP
GNUmoon2 has quit [Remote host closed the connection]
GNUmoon2 has joined #glasgow
GNUmoon2 has quit [Remote host closed the connection]
GNUmoon2 has joined #glasgow
pg12_ has joined #glasgow
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
jstein has quit [Quit: quit]
pg12_ has quit [Ping timeout: 240 seconds]
pg12_ has joined #glasgow
PyroPeter_ has joined #glasgow
PyroPeter has quit [Ping timeout: 268 seconds]
PyroPeter_ is now known as PyroPeter
m4ssi has joined #glasgow
futarisIRCcloud has joined #glasgow
m4ssi has quit [Remote host closed the connection]
GNUmoon2 has quit [Ping timeout: 240 seconds]
GNUmoon2 has joined #glasgow
Eli2_ has joined #glasgow
Eli2 has quit [Remote host closed the connection]
GNUmoon2 has quit [Remote host closed the connection]
GNUmoon2 has joined #glasgow
GNUmoon2 has quit [Ping timeout: 240 seconds]
GNUmoon2 has joined #glasgow
marvs_ is now known as marvs
marvs has joined #glasgow
marvs has quit [Changing host]
futarisIRCcloud has quit [Quit: Connection closed for inactivity]
GNUmoon2 has quit [Ping timeout: 240 seconds]
GNUmoon has joined #glasgow
janhenrik has quit [Remote host closed the connection]
<d1b2>
<Nana> @Attie it seems that asyncio.sleep is not waiting (at least when calling: await iface.write (data), await asyncio.sleep (1), await iface.write (data)). But maybe I misunderstood something here and I need to take care of the scheduling?
TD-Linux has quit [Ping timeout: 260 seconds]
janhenrik has joined #glasgow
TD-Linux has joined #glasgow
<d1b2>
<Attie> it should do - could you share your code somewhere?
<d1b2>
<Nana> the actual code for this test is nothing more than: await iface.write([0x00]) await asyncio.sleep(2) await iface.write([0xFF])
<d1b2>
<Nana> and calling it via glasgow script
<whitequark>
add `await iface.flush()` before `asyncio.sleep`
<d1b2>
<Nana> oh, wasn't aware of this one. it did work, thank you
<d1b2>
<Attie> ah, great!
<d1b2>
<Attie> @whitequark - i didn't need that previously when working with I2C... is this new for everything, or only required for certain interfaces (which is my expectation)
<whitequark>
look up how TCP sockets work
<whitequark>
I2C reads are internally a write and a read from the underlying stream oriented buffered transport
<whitequark>
so higher layer protocols hide the flushes (not always but usually)
<d1b2>
<Attie> is this using TCP, or similar concept? I was expecting the auto_flush flag to be at play here
<whitequark>
it is not using TCP (currently), but it is a stream oriented transport that is functionally similar
<whitequark>
auto_flush is just for the gateware
<d1b2>
<Attie> understood, thanks!
<whitequark>
arguably this could be different, but it isn't
<d1b2>
<Attie> could be different, but i don't think it needs to be!
<d1b2>
<Attie> might be good to put an example with the flush gotcha included
<d1b2>
<Attie> (@Nana , depending on what you're doing/working with, fancy a PR?)
<whitequark>
sigh
<whitequark>
i hate this. "gotchas" that require "examples" to learn
<whitequark>
awful design
<d1b2>
<Attie> ... i get that / sorry for shining a light on it (or perhaps my wording?)
<whitequark>
first you say that it doesn't need to be different, then you call it a gotcha. pick one
<whitequark>
i lean towards the latter, personally
<whitequark>
but it's rather not obvious how to fix it and still keep the throughput we'd like to have
<d1b2>
<Attie> i guess, from my point of view, it's a technical thing, with a technical reason. once you're aware of how things work underneath, it becomes a thing you know to look for
<d1b2>
<Attie> as you say (re throughput), changing this will cause ripples and affect other things
<d1b2>
<Attie> it is a gotcha, but it's also not totally unreasonable... if that tracks(?)
<d1b2>
<Attie> my only thought would be to add a "flush=True" arg to the write, so it can be overridden when you're after the tigher control/performance
<d1b2>
<Attie> or perhaps something more like TCP_CORK, where you can "pause" the stream, put stuff in the buffer, and then say "go!"
<whitequark>
yeah and how many networking applications set TCP_NODELAY the first thing?
<d1b2>
<Attie> buut... with reasonable docs / examples, this extra complexity becomes unnecessary (crosses-fingers)
<whitequark>
er, CORK is different, but that's even worse, it's hidden state rather than state at boundary
<whitequark>
flush=True is, perhaps, reasonable. it should not cause deadlocks, although it may regress throughput, and a lot of things will have to be audited
<d1b2>
<Attie> yeah...
<whitequark>
something to think of later, I guess
<d1b2>
<Attie> agreed
pg12_ has quit [Ping timeout: 252 seconds]
pg12_ has joined #glasgow
roybatty has joined #glasgow
<_whitenotifier-5>
[libfx2] whitequark commented on issue #6: How to write a response in chunks (USB control read)? - https://git.io/JY0T0
<_whitenotifier-5>
[glasgow] whitequark commented on issue #281: P and N pins are swapped on revC2 - https://git.io/JY0TN
<d1b2>
<Hardkrash> I like using context managers to temporarily override “default” timeouts and other parameters.
<d1b2>
<Hardkrash> for example
<whitequark[m]>
the problem is that it's still global state, just automatically cleaned up
<whitequark[m]>
so it makes it harder to compose interface implementations, which is the whole point of glasgow as a tool
<d1b2>
<Hardkrash> `with interface.timeout = 5:
<whitequark[m]>
using a defaulted arg is more local, though not entirely so
Guest80008 is now known as Foone
<d1b2>
<Hardkrash> the context manager can be local as well, and contained in the sub class and tidies up after itself.
m4ssi has joined #glasgow
Foone is now known as Guest10477
<d1b2>
<Hardkrash> in composting in my automation experience chaining the defaulted arguments down the rabbit hole leads to a messier function signature.
<whitequark[m]>
if you stuff the mess into the global state it does not go away, it's just harder to understand
<whitequark[m]>
this is sometimes appropriate but very rarely so
<d1b2>
<Hardkrash> i don't know if i understand how you are defining global here, I don't see the code that i have written as global state. in a mutexed interface it is not at a global level, but I might be missing what makes this global in Glasgow's context.
<whitequark[m]>
a high-level glasgow applet is a stack of interface classes that ultimately operate on an (currently USB) FIFO
<whitequark[m]>
flushing and timeouts are a property of the FIFO
<d1b2>
<Hardkrash> is that fifo a shared resource?
<d1b2>
<Hardkrash> or owned by a stack of classes?
<whitequark[m]>
so either only the lowest-level applet manipulates the FIFO, in which case there is no need for context managers (if you need all writes to look a certain way, you use a function--and a lot of applets already do wrap FIFO writes that way), or multiple interface classes manipulate the FIFO state, such as flushing, in which case it has the same fundamental issues as global state
<whitequark[m]>
in neither of these cases are context managers solving anything. at best you're rearranging things around
<whitequark[m]>
the FIFO is owned by the stack of classes. it's effectively the lowest layer of the stack, the only one provided by the device communication code itself
<d1b2>
<Hardkrash> I see that prospective, but there is the third case that i use. Where some times calls need to have special parameters. in efforts to not burden the function signatures throughout the stack about understanding other layers configurations, you now gain abstraction that can skip layers and ease compostability with mix-ins.
<whitequark[m]>
"abstraction that skips layers" is an oxymoron
<whitequark[m]>
with timeouts in particular, if a certain layer in the stack does not support them, it means they are not supported period. if you try to interrupt a layer that doesn't explicitly opt into that, you have to reset the entire thing, including the gateware
<d1b2>
<Hardkrash> would the phrasing be that a peer layer need not know about it's full peers function signatures?
<_whitenotifier-5>
[glasgow] marcan commented on issue #281: P and N pins are swapped on revC2 - https://git.io/JY0ls
<whitequark[m]>
i don't really care about function signatures
<whitequark[m]>
either a layer is designed to be interrupted with a timeout, or not, and if you do design something to be recoverable after an interrupt, function signatures are the least complex of your problems
<whitequark[m]>
to rephrase
<whitequark[m]>
if you use a context manager this way, it means that all of the functions down the stack gain an additional implicit argument that everyone working on them must know about and consider when changing or inspecting
<whitequark[m]>
that is a very large hammer that is sometimes appropriate, but most of the time, making the signature "messier" actually makes it more clear exactly what inputs affect the state at any given level
<whitequark[m]>
if the additional arguments annoy you, perhaps you should reconsider your entire approach rather than shuffling them under the rug
<_whitenotifier-5>
[glasgow] whitequark commented on issue #281: P and N pins are swapped on revC2 - https://git.io/JY04T
bvernoux has joined #glasgow
bvernoux1 has joined #glasgow
bvernoux has quit [Ping timeout: 240 seconds]
bvernoux1 has quit [Quit: Leaving]
bvernoux has joined #glasgow
bvernoux has quit [Remote host closed the connection]
bvernoux has joined #glasgow
<_whitenotifier-5>
[glasgow] electroniceel commented on issue #281: P and N pins are swapped on revC2 - https://git.io/JY01u
<_whitenotifier-5>
[glasgow] whitequark unassigned issue #281: P and N pins are swapped on revC2 - https://git.io/JYlsx
Guest10477 is now known as Foone
GNUmoon has quit [Ping timeout: 240 seconds]
egg|anbo|egg has joined #glasgow
GNUmoon has joined #glasgow
bvernoux has quit [Quit: Leaving]
<_whitenotifier-5>
[glasgow] TomKeddie commented on issue #281: P and N pins are swapped on revC2 - https://git.io/JYEtd
trh has quit [Quit: weg]
trh has joined #glasgow
umarcor has quit [Read error: Connection reset by peer]
siriusfox_ has joined #glasgow
bgamari_ has joined #glasgow
ZirconiumX has joined #glasgow
edef_ has joined #glasgow
edef has quit [Killed (beckett.freenode.net (Nickname regained by services))]
edef_ is now known as edef
bgamari has quit [Ping timeout: 265 seconds]
sknebel_ has joined #glasgow
Ekho- has joined #glasgow
Ekho has quit [Ping timeout: 265 seconds]
siriusfox has quit [Ping timeout: 265 seconds]
m4ssi has quit [Remote host closed the connection]
umarcor has joined #glasgow
Lofty has quit [Ping timeout: 240 seconds]
sknebel has quit [Ping timeout: 240 seconds]
marvs has quit [Ping timeout: 240 seconds]
marvs has joined #glasgow
Ekho- is now known as Ekho
<d1b2>
<mossmann> What part is the yellow LED in the upper right? It looks like it might be more bright yellow and less amber than most yellow LEDs (not that it is easy to tell in a photo).