On Wed, 3 Mar 2021 18:11:27 -0500, in gmane.comp.hardware.beagleboard.user
Don Pancoe <donpancoe-re5jqeeqqe8avxtiumw...@public.gmane.org> wrote:


>The PCBA test program is a long series of while loops, if statements and
>timeout counters that wait for inputs and evaluate them, or move on if
>they're taking too long. I was thinking of using an AdafruitBB_IO edge
>detect to watch for an abort button press, then having that trigger a
>function that handles any wrap-up tasks and calls a *break* function to pop
>out of the main test loop to another outer loop so that it returns to the
>top of the test. I'm actually doing this now to halt the test if the
>in-circuit programmer reports a flashing failure. The difference is: the
>programmer failure happens at a known point where I know to look for it,
>but the abort button should be able to be used at any time.
>
>One idea I've had but not tested yet is to replace the *sleep()* functions
>I judiciously use for timing throughout the test with a custom function
>that breaks the sleep period (anywhere from 10 ms to 10 s) into smaller
>chunks interspersed with checking of the abort button GPIO. This I could do
>just with libpruio as suggested by TJF. Theoretically, I could wait for
>every subsequent while loop to time out at 60 seconds each, but that's not
>practical for test throughput, or when you are billed for testing by the
>minute.
>

        If using Adafruit_BBIO edge detect with a call-back function, that
call-back probably should do nothing more than set a "global" flag.

        Your sleep() and loops would then include something like "while not
abortFlag".  

        There is no easy way in Python to back out of multiple levels of loops
except via an exception (so something like "if abortFlag: raise
customAbortException"). You'd catch that exception at the outermost level,
and the handler does the clean-up. A one-level loop can be exited with
"break".


-- 
Dennis L Bieber

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/ikm04gtkhni4rvnvbon1nfffuk76nmkf6l%404ax.com.

Reply via email to