<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dikstra's 1973 proposal of the new language statement was about
the time I was first using Fortran. In retrospect, the extra
(accidental) genius of Dijkstra is that he conjured it just one
year after the release of the Signetics write only memory. The
Signetics device would have been an ideal destination for the
results of programs heavily depending on the come from statement.</p>
<p>-Pete <br>
</p>
<div class="moz-cite-prefix">On 7/1/20 10:45 AM, Rick DeNatale via
TriEmbed wrote:<br>
</div>
<blockquote type="cite"
cite="mid:1d1f9575-f13f-433b-ae26-8980e25eb337@iPad-6">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div id="edo-message">How many of you are old enough to remember
FORTRANs computed go to, and its evil twin the computed come
from. <a
href="https://web.archive.org/web/20180716171336/http://www.fortran.com/fortran/come_from.html"
style="letter-spacing: 0.1px; text-align: inherit;
-webkit-tap-highlight-color: transparent;"
moz-do-not-send="true">https://web.archive.org/web/20180716171336/http://www.fortran.com/fortran/come_from.html</a></div>
<div id="edo-original">
<div><br>
<br>
<blockquote type="cite" style="margin:1ex 0 0 0; height:
min-content; border-left:1px #ccc solid;padding-left:0.5ex;">
<div>On Jul 1, 2020 at 9:13 AM, <<a
href="mailto:triembed@triembed.org"
moz-do-not-send="true">Scott Hall via TriEmbed</a>>
wrote:<br>
<br>
</div>
<div>
<div dir="ltr">
<div>NO NO, DON'T USE GOTO !</div>
<div><br>
</div>
<div>Seriously though, this has been a behaviour of the
Arduino compiler compilation for a while -- its even
mentioned in some Arduino books. The workaround is to
have a single function called for each case label and
to put the statements desired with the function. This
gets optimized to a jump table anyway, so its just a
matter of doing this in practice.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Jul 1, 2020 at
12:34 AM Jon Wolfe via TriEmbed <<a
href="mailto:triembed@triembed.org"
moz-do-not-send="true">triembed@triembed.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div lang="EN-US">
<div
class="gmail-m_-6405481849140748973WordSection1">
<p class="MsoNormal">Yep, GCC has a ton of
extensions to C and C++, though they obviously
need careful consideration when using, if it’s
work the downside of making the code less
portable. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><a
href="https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/C-Extensions.html"
target="_blank" moz-do-not-send="true">https://gcc.gnu.org/onlinedocs/gcc-5.2.0/gcc/C-Extensions.html</a></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">One of my favorites is local
functions. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<div style="border-color:rgb(225,225,225)
currentcolor currentcolor;border-style:solid
none none;border-width:1pt medium
medium;padding:3pt 0in 0in">
<p class="MsoNormal" style="border:medium
none;padding:0in"><b>From: </b><a
href="mailto:ncgadgetry@gmail.com"
target="_blank" moz-do-not-send="true">Rodney
Radford</a><br>
<b>Sent: </b>Tuesday, June 30, 2020 9:04 PM<br>
<b>To: </b><a
href="mailto:jonjwolfe@anibit.com"
target="_blank" moz-do-not-send="true">Jon
Wolfe</a><br>
<b>Cc: </b><a
href="mailto:triembed@undecidedgames.net"
target="_blank" moz-do-not-send="true">Brian</a>;
<a href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">Triangle
Embedded Computing Discussion</a><br>
<b>Subject: </b>Re: [TriEmbed] Hacking a fake
vintage radio (with Arduino + Pi 0)</p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
<div dir="ltr">
<div dir="ltr">
<div>I had never heard of the GCC label variable,
so I had to google it... wow, I learned
something new tonight!</div>
<div><br>
</div>
<div><a
href="https://stackoverflow.com/questions/1777990/is-it-possible-to-store-the-address-of-a-label-in-a-variable-and-use-goto-to-jum"
target="_blank" moz-do-not-send="true">https://stackoverflow.com/questions/1777990/is-it-possible-to-store-the-address-of-a-label-in-a-variable-and-use-goto-to-jum</a><br>
<br>
</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div class="gmail_attr" dir="ltr">On Tue, Jun 30,
2020 at 8:57 PM Jon Wolfe via TriEmbed <<a
href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">triembed@triembed.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px
0px 0px 0.8ex;padding-left:1ex;border-left:1px
solid rgb(204,204,204)">
<div lang="EN-US">
<div>
<p class="MsoNormal"> </p>
<p class="MsoNormal">There is a trick you can
use with gcc that is a non-standard C
construct where you can use ‘goto’ and give
it a variable containing the address of a
label. You then create an array of label
address and you can then dynamically index
that array to jump to various locations.
I’ve seen it used as an optimization
technique, and you can also have more
control over the program flow, though it is
using the infamous keyword, Essentially
though it end up looking pretty much like a
switch-case. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">That is really odd about
that gcc bug. It’s not like I’ve never seen
them, but 99.9% of the time when I thought I
had found a compiler bug in C/C++, it turns
out to be something else. (hafl the time one
of those things that disappears with a
“clean/rebuild all”) I remember the Arduino
/AVR/gcc linker used to have a bug related
to 8-bit AVR chips that had more than 64KB
of flash memory, such as the ATMega 1284.
Those chips address by 16 bit words not
bytes, so 128kb of flash is accessible
without trick likes far pointers, but the
linker would mess up the address
calculations sometimes I think for interrupt
handlers or functions called by interrupt
handlers that crossed the 64kb boundary. </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<div style="border-width:1pt medium
medium;border-style:solid none
none;border-color:rgb(225,225,225)
currentcolor currentcolor;padding:3pt 0in
0in">
<p class="MsoNormal"
style="padding:0in;border:medium none"><b>From:
</b><a href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">Huan
Truong via TriEmbed</a><br>
<b>Sent: </b>Tuesday, June 30, 2020 12:48
PM<br>
<b>To: </b><a
href="mailto:triembed@undecidedgames.net"
target="_blank" moz-do-not-send="true">Brian</a><br>
<b>Cc: </b><a
href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">Triangle
Embedded Computing Discussion</a><br>
<b>Subject: </b>Re: [TriEmbed] Hacking a
fake vintage radio (with Arduino + Pi 0)</p>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
Oh yeah, that explains my issue. I definitely ran
into that issue<br>
where I have checked and had no reason to believe
I was doing<br>
something wrong, yet, when I evacuated each switch
to a function, the<br>
switch worked correctly. But neither scoping with
an anonymous scope<br>
nor renaming the variables work.<br>
<br>
The reason I used the switch was that I read on
stackoverflow at one<br>
point and someone said that we should use switches
instead of elseifs<br>
when we have a lot of cases. Then, using switches,
the compiler will<br>
be able to (at some point) create a lookup table
for you so it's<br>
faster. I doubt that was what happening at least
on the Arduino case.<br>
You'll need a giant lookup table which the uCs
don't have memory for.<br>
I suspect that in a lot of cases, using switches
is probably just as<br>
slow as using elseifs. Now as I see that it is so
buggy, I probably<br>
will not use switches, at least on Arduino.<br>
<br>
Cheers,<br>
- Huan.<br>
<br>
On Tue, Jun 30, 2020 at 9:23 AM Brian via TriEmbed<br>
<<a href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">triembed@triembed.org</a>>
wrote:<br>
><br>
> Side note:<br>
><br>
> The arduino compiler has bugs in how it
handles switch statements. I've<br>
> run into situations lately where the order of
the case statements matter<br>
> (which it never should); cases are completely
ignored, etc.<br>
><br>
> I believe it may be tied to the use of local
scoping within a case, e.g.:<br>
><br>
> switch(thing) {<br>
> case 1:<br>
> {<br>
> // stuff with case-local scope<br>
> }<br>
> break;<br>
> }<br>
><br>
> Syntactically- and semantically-correct code
has proven to generate<br>
> incorrect runtime results.<br>
><br>
> I haven't had time/motivation to submit a bug
report, but I should do<br>
> that. At any rate, a potential workaround is
to reorder your cases.<br>
><br>
> -B<br>
><br>
> On 6/24/20 9:51 PM, Huan Truong via TriEmbed
wrote:<br>
> > Thanks Pete!<br>
> ><br>
> > I feel like there was something really
mysterious about the switch statement. Even if I
pasted the whole blocks of code of each function I
would have called to the {} inside a case, the
code still wouldn’t work. That baffled me by a
mile.<br>
> ><br>
> > But yeah, I spent way too much time on
the project that I’m comfortable with the idea of
not understanding some of it now. The watchdog
timer code was baffling too.<br>
> ><br>
> > Please excuse my typos, sent from phone.<br>
> ><br>
> > On Jun 24, 2020, at 10:14 AM, Pete Soper
via TriEmbed <<a
href="mailto:triembed@triembed.org"
target="_blank" moz-do-not-send="true">triembed@triembed.org</a>>
wrote:<br>
> ><br>
> > What a beautifully presented adventure.
Loved reading it. And when you say a problem
"could be bad" you make your point. :-) (meant as
a "find Waldo" exercise for alert readers)<br>
> ><br>
> > Hadn't heard of "kev" or any other
Arduino emulator for that matter. That aspect was
interesting too.<br>
> ><br>
> > The other issue with redeclaration of
the vars local to the switch statement is that
they literally don't exist outside it, so
communicating their values outside the block would
be difficult. :-) In general, every {} defines a
local scope in C/C++ and you can declare variables
inside that scope but they cease to be defined
outside the scope. The scope outside any {} (aka
"global") or vars declared "static" can avoid this
issue but not the redefine issue.<br>
> ><br>
> > Thanks for sharing this!<br>
> ><br>
> > Pete<br>
> ><br>
> ><br>
> >> On 6/24/20 12:43 PM, Huan Truong via
TriEmbed wrote:<br>
> >> This has taken me way more time than
I thought, but finishing this<br>
> >> retrofit is a big achievement for
me. It's really silly and serves<br>
> >> exactly no purpose other than RE'ing
something no one cares about. So<br>
> >> I just want to share for some shits
and giggles.<br>
> >><br>
> >> <a
href="http://www.tnhh.net/posts/adventures-hacking-fake-vivitar-vintage-radio.html"
target="_blank" moz-do-not-send="true">http://www.tnhh.net/posts/adventures-hacking-fake-vivitar-vintage-radio.html</a><br>
> >><br>
> >><br>
> >><br>
> >><br>
> >><br>
> ><br>
> >
_______________________________________________<br>
> > Triangle, NC Embedded Computing mailing
list<br>
> ><br>
> > To post message: <a
href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
> > List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
> > TriEmbed web site: <a
href="http://TriEmbed.org" target="_blank"
moz-do-not-send="true">http://TriEmbed.org</a><br>
> > To unsubscribe, click link and send a
blank message: mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
> ><br>
> ><br>
> >
_______________________________________________<br>
> > Triangle, NC Embedded Computing mailing
list<br>
> ><br>
> > To post message: <a
href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
> > List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
> > TriEmbed web site: <a
href="http://TriEmbed.org" target="_blank"
moz-do-not-send="true">http://TriEmbed.org</a><br>
> > To unsubscribe, click link and send a
blank message: mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
> ><br>
><br>
><br>
>
_______________________________________________<br>
> Triangle, NC Embedded Computing mailing list<br>
><br>
> To post message: <a
href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
> List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
> TriEmbed web site: <a
href="http://TriEmbed.org" target="_blank"
moz-do-not-send="true">http://TriEmbed.org</a><br>
> To unsubscribe, click link and send a blank
message: mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
><br>
<br>
<br>
-- <br>
<br>
Huan Truong<br>
www <a href="http://tnhh.net" target="_blank"
moz-do-not-send="true">tnhh.net</a> / twitter
@huant<br>
<br>
_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a
href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
target="_blank" moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org"
target="_blank" moz-do-not-send="true">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank
message: mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a
href="mailto:TriEmbed@triembed.org"
target="_blank" moz-do-not-send="true">TriEmbed@triembed.org</a><br>
List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank
message: mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote>
</div>
_______________________________________________<br>
Triangle, NC Embedded Computing mailing list<br>
<br>
To post message: <a
href="mailto:TriEmbed@triembed.org" target="_blank"
moz-do-not-send="true">TriEmbed@triembed.org</a><br>
List info: <a
href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a><br>
TriEmbed web site: <a href="http://TriEmbed.org"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://TriEmbed.org</a><br>
To unsubscribe, click link and send a blank message:
mailto:<a
href="mailto:unsubscribe-TriEmbed@bitser.net"
target="_blank" moz-do-not-send="true">unsubscribe-TriEmbed@bitser.net</a>?subject=unsubscribe<br>
<br>
</blockquote>
</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>Scott G. Hall<br>
Raleigh, NC, USA<br>
<a href="mailto:scottghall1@gmail.com"
target="_blank" moz-do-not-send="true">scottghall1@gmail.com</a></div>
<i>Although kindness is rarely a job, no
matter what you do it's always an option.</i><br>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________
Triangle, NC Embedded Computing mailing list
To post message: <a class="moz-txt-link-abbreviated" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a>
List info:
<a class="moz-txt-link-freetext" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a class="moz-txt-link-freetext" href="http://TriEmbed.org">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message:
<a class="moz-txt-link-freetext" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>
</div>
</blockquote>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
Triangle, NC Embedded Computing mailing list
To post message: <a class="moz-txt-link-abbreviated" href="mailto:TriEmbed@triembed.org">TriEmbed@triembed.org</a>
List info: <a class="moz-txt-link-freetext" href="http://mail.triembed.org/mailman/listinfo/triembed_triembed.org">http://mail.triembed.org/mailman/listinfo/triembed_triembed.org</a>
TriEmbed web site: <a class="moz-txt-link-freetext" href="http://TriEmbed.org">http://TriEmbed.org</a>
To unsubscribe, click link and send a blank message: <a class="moz-txt-link-freetext" href="mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe">mailto:unsubscribe-TriEmbed@bitser.net?subject=unsubscribe</a>
</pre>
</blockquote>
</body>
</html>