shawn's latest activity

  • S
    For the record, the QNEthernet library doesn’t have to use EventResponder or hook into yield(). In fact, that’s how it started out. The only thing that you need is to call Ethernet.loop() regularly. (And comment out the attachLoopToYield() call.)...
  • S
    shawn reacted to PaulStoffregen's post in the thread Sampling voltage with Teensy 4.1 with Like Like.
    Indeed many years ago I tested almost every breadboard I could find, about 40 different models (but many were probably the same with different packaging). BPS and Twin Industries were by far the best quality. That's why PJRC sells the BPS...
  • S
    When you want to, removing a Teensy from a prototyping board can be a challenge. There is a temptation to lift it just from one end. DO NOT DO THIS. The Teensy will likely give way quickly and pins will probably be bent. As a better solution for...
  • S
    shawn replied to the thread Ethernet audio library.
    Just to be clear, I wasn’t suggesting doing audio updating from the main loop, just sending things over Ethernet from the main loop, where the things you’re sending are buffered in the interrupt. This is almost equivalent to hooking into yield()...
  • S
    @h4yn0nnym0u5e would you then advocate for having a user call SomeLibrary.loop() inside their main program loop, plus anywhere they’d wait, instead of hooking into yield (whatever the mechanism)? (Eg. QNEthernet)
  • S
    shawn replied to the thread Ethernet audio library.
    Better yet, in the interrupt, append the data you need to send to a concurrent-safe or “mutexed” queue/buffer and then in your main loop (or in a function called from your main loop), send the data you need from the queue.
  • S
    shawn replied to the thread Ethernet audio library.
    The library isn’t designed to be called from within interrupts. The alternative is to set a (volatile) flag in the interrupt and then check that flag to do the operation from your main loop somewhere (and then clear the flag), i.e. not in an...
  • S
    Yes, that's right. I first modified the example to do what I wanted my simple TCP server to do, and then tried to merge that functionality into the multi-tasking application, and that's when I ran into the issue related to yield().
  • S
    I see. I was confused when you said, "since it did what I wanted." Did you mean when you didn't use the cooperative OS features?
  • S
    Can you clarify: which example did what you wanted? Did it call one of the waiting functions? If so and it worked, what exactly didn’t work for you before? My impression was that something actually didn’t work for you, as opposed to...
  • S
    I think what happened is a tried an example, and since it did what I wanted, I never looked beyond it. When I download your modified code, I'll try the non-blocking functions. Thanks very much!
  • S
    My view is that if you’re advanced enough to do your own cooperative task switching, you don’t actually need to use those functions in QNEthernet that use yield(). I don’t mind the change because, in theory, someone could have overridden yield()...
  • S
    @joepasquariello The latest two commits in the QNEthernet library repo should address your needs. (96db12b1d and 9c572384f: https://github.com/ssilverman/QNEthernet/commits/9c572384f2998dc80883d55c02f8b23480868cfc/) But I have a question: Why...
  • S
    shawn replied to the thread Teensyduino 1.60 Beta #1.
    I’m on macOS 14.7, hardware is one of the last Intel hardware ones, 2020.
  • S
    I wonder if EventResponder::attachImmediate is similar to this?
  • S
    That’s very system-specific. I was referring being able to tell if a function is overridden, but I guess that would only be known by the linker.
  • S
    @joepasquariello Sure, I can call Ethernet.loop() before (or after or whatever) the yield() calls. (I think it would be interesting if there was a way I could tell if yield() was overridden.) I don’t think this will have a huge impact because use...
  • S
    @joepasquariello One idea is I could add a configuration parameter that makes the user call Ethernet.loop() at the end of the main program loop() and that causes EventResponder to not be used.
  • S
    It uses linker script magic to get pointers to the sections with a NULL pointer marking the end of each. I left the rejected PR open just in case the code would be useful to someone: https://github.com/PaulStoffregen/cores/pull/734/files
  • S
    That’s a good question. If it’s QNEthernet-specific, maybe an issue in the repo? We could hash improvements out there.
  • S
    I’d love to see some example code for this. Are you saying that there’s one “master override” for that startup hook, and then that main function loops through some pointers and calls each one, depending on where it is? How do you determine which...
  • S
    What about those cases, for example in the QNEthernet library, where a user-called function needs to wait for something? I think it’s an appropriate use of yield() inside the “wait for condition” loop. But on the other hand, this is user-called...
  • S
    That’s not quite the intent. I don’t rely on yield() being overridden; I rely on something being called regularly. It so happens that EventResponder provides that feature by making sure something is called every time loop() finishes without the...
  • S
    The QNEthernet library doesn't override yield(). I hook into the EventResponder system's yield hook. Look for attachLoopToYield(). Below that code, however, is a commented-out example of how to call Ethernet.loop() from an overridden yield() on...
  • S
    @shawn, thanks for the offer. It will take me a few days to get the hardware ready for you. I will PM you once it is ready to ship. The Single Pair Ethernet chipset is the Microchip LAN8651 10Base-T1S MAC/PHY. It talks to the Teensy via SPI...
  • S
    @skpang if you feel like sending me some hardware, and if there’s good documentation for that PHY, I’ll write a QNEthernet driver for it.
  • S
    shawn replied to the thread Ethernet audio library.
    The internal queue is a circular buffer (a vector) because then there’s no extra allocation. With a linked list, I’d have to use a pool of pre-allocated objects, and I think the implementation would be a little more complex. It sounds like doing...
  • S
    shawn replied to the thread Ethernet audio library.
    Thinking aloud here… I wonder if it would be useful if I gave access to the internal queue, or if what you suggest, having a separate queue in your program, is the way to go. “UDP layer” and “application layer” being separate, etc. Or maybe I...
  • S
    shawn replied to the thread Ethernet audio library.
    Here's a tip: To access a packet's data, you don't need to copy it into a local buffer. You can simply call data() on the UDP object to access a pointer to the data, and size() to get the data size. That will save some memory and time.
  • S
    shawn replied to the thread Ethernet audio library.
    I built and use the QNEthernet library for my own uses and use it in the field for streaming buffered pixel and controls data, and serving web pages for configuration. But it can do a lot more. I’m looking forward to your experiences using it for...
  • S
    shawn replied to the thread Ethernet audio library.
    My suggestion is not to use the AsyncUDP_Teensy41 library plus your own buffering because the QNEthernet library already provides configurable buffering. This is, in fact, one of the reasons I don’t recommend that “async” library; when buffering...
  • S
    I’m going to bookmark this thread and point to it in the future because it’s a perfect example of why including some code in one’s question will very possibly lead to a solution much more quickly.
  • S
    I was suggesting to not use the threading library. Please clarify one point: did you want blocking behaviour or not? I’m unclear from the description.
  • S
    What happens if you don’t use threads? I.e. call functions one after the other, and if any need to be done periodically, use time measurement.
  • S
    I'm not a fan of Arduino's architecture names. My general feeling is we need to make the best of a bad situation. Even though all the Teensy 2 and Teensy 3 hardware is discontinued, we're still publishing software support. So today we're...
  • S
    I was making a PR for the Arduino_ConnectionHandler project (https://github.com/arduino-libraries/Arduino_ConnectionHandler/pull/128), and the build complained (just a warning) that AVR platforms aren't supported. That finally pushed me to write...
  • S
    shawn replied to the thread This Should Never Happen.
    I’ve seen these once or twice too over my Teensy dev lifetime.
  • S
    One basic thing I noticed is that you're accessing client.operator bool() from several different contexts. The state may be indeterminate, especially since you're copying into the object from outside the ISR with client = server.accept();, and...
  • S
    Fun fact: I've added a way in the QNEthernet library to redirect stdout and stderr. There shouldn't be a need to follow the mentioned link above...
  • S
    Here's a minor-fix PR: 1. Make some minor fixes to CrashReport CFSR messages #716 Here's some fixes discovered with "-Wextra": 1. Fix some "cast between incompatible function types" warnings in usb_midi #694 2. Fix an "implicitly-declared copy...
  • S
    Hello. Just seeing if there are any Teensy LC’s out there.
  • S
    shawn replied to the thread Spare Teensy LC's.
    I think I’ll start a new thread… I did see that you had run out, per post #4. For some reason I thought using this thread would be more efficient.
  • S
    shawn replied to the thread Spare Teensy LC's.
    I could use a few Teensy LC’s if anyone has any more.
  • S
    shawn replied to the thread Issues with time_t in printf().
    I meant <cstdio>, not <stdio.h>.
  • S
    shawn replied to the thread Issues with time_t in printf().
    The printf() functions should normally warn you when the parameter type doesn’t match, for example “%lu” and time_t, which should be “%llu”. However, the Teensyduino implementation of the Print interface (which contains a printf(), and is the one...
  • S
    Sadly, our art car was destroyed on its way back from the playa this year when a drunk driver rear-ended our trailer at over 100mph. So this was its last ride. But thank you to PJRC, Teensy, OctoWS2811 and all the support over the years. It was a...
  • S
    Here's a version without the VLAN processing: // C++ includes #include <algorithm> #include <QNEthernet.h> using namespace qindesign::network; // VLAN EtherType constants constexpr uint16_t kEtherTypeVLAN = 0x8100u; constexpr uint16_t...
  • S
    See this thread where I post how to use the QNEthernet library to do raw frame processing without an IP stack...
  • S
    Good news is that you shouldn't have to do all this work yourself. I've designed the QNEthernet library to work without an IP stack, and with an "EthernetFrame" API similar to the "EthernetUDP" API. In other words, you can easily use the library...
  • S
    First point is that the following will also work, without the use of #ifdef's: bool poll() override { yield(); return static_cast<bool>(server.available()); } EthernetServer::available() returns an instance of EthernetClient. EthernetClient...
Back
Top