<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How  to implement LCD menu structure</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/19204/how-to-implement-lcd-menu-structure</link><description> Hello all, 
 
I have to implement a MENU screen including a few sub menu&amp;#39;s on a 230x240 pixel LCD display. Selecting sub-menu&amp;#39;s is done through digital inputs(buttons). I can poll these inputs or generate an interrupt to detect an active input. 
 
I</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/123063?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 17:34:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cca9eb30-4bd0-464c-865d-33dfca4c42c3</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Control can sometimes be embodied in data.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Very true.&lt;br /&gt;
&lt;br /&gt;
One way to do it is tables of function pointers. I know this is problematic on C51, but I guess it should be OK on an ARM?&lt;br /&gt;
&lt;br /&gt;
If you don&amp;#39;t like or can&amp;#39;t use function pointers, you can simply use an ID in a switch to do direct calls; eg,&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;switch( menu_option )
{
   case OPTION_1:
      sub_menu_1();
      break;

   case OPTION_2:
      sub_menu_2();
      break;

   case OPTION_3:
      action_3();
      break;

   case OPTION_4:
      action_4();
      break;

   default:
      show_help();
      break;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/111815?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 14:40:44 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:474be12d-8d9f-483f-9f48-9f5ee3f9260a</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;If your style looks messy, try to refine it, or change it.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Control can sometimes be embodied in data.&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Show me your flowcharts and conceal your tables, and I shall continue to be mystified.  Show me your tables, and I won&amp;#39;t usually need your flowcharts; they&amp;#39;ll be obvious.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Frederick P. Brooks, Jr., &lt;i&gt;The Mythical Man Month&lt;/i&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/97680?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 14:22:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:54295edd-aa56-4f4a-bf27-2d7ffccf4a45</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;I find the software look very messy.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
This is largely a matter of style - and that is under your control!&lt;br /&gt;
&lt;br /&gt;
If your style looks messy, try to refine it, or change it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/111816?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 12:01:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ca9f632f-57c9-45a5-bcb5-5e350d502a0e</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;sorry, re above:&lt;br /&gt;
&lt;br /&gt;
I missed the &amp;quot;ARM&amp;quot; the above apply to the &amp;#39;51.&lt;br /&gt;
&lt;br /&gt;
Anyhow, I doubt Keil could stay in business if the switch statement did not &amp;quot;work reliably&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/97681?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 11:45:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3f15edf1-021b-48f0-bea2-817d166f6ed7</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;i&gt;I am bussy maken software that is using a lot of switch statements as well.&lt;br /&gt;
&lt;br /&gt;
Does it work reliable?&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
can&amp;#39;t answer that, I did not write the code :).&lt;br /&gt;
&lt;br /&gt;
If the question is: &amp;quot;does the switch stement work as stated in ANSI C?&amp;quot; I have never seen any notion in this forum or in my work that it does not.&lt;br /&gt;
&lt;br /&gt;
One caveat: it does take time.&lt;br /&gt;
&lt;br /&gt;
I think that at one time I saw it converted to a jump table (in Keil?) and would &lt;b&gt;absolutotally love&lt;/b&gt; to know how to make it so that happens in Keil.  I can appreciate that you have to &amp;quot;help&amp;quot; the compiler by not using willy-nilly values for the cases.  I have tried offset by 2 for the cases with no improvement.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/73672?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 10:37:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:46ea3793-171a-4315-a37c-571ee283a2a6</guid><dc:creator>Jan Kist</dc:creator><description>&lt;p&gt;I am bussy maken software that is using a lot of switch statements as well.&lt;br /&gt;
&lt;br /&gt;
Does it work reliable?&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
&lt;br /&gt;
Jan&lt;br /&gt;
&lt;br /&gt;
P.s. I find the software look very messy. Thats why I am looking for better/other options.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/87490?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 09:48:25 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:13403ef0-108f-47a0-89d1-b14df146e59d</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;Is it OK to use function pointers in your system?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How  to implement LCD menu structure</title><link>https://community.arm.com/thread/45143?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2005 07:40:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:590813e9-1a51-4bdf-896e-46975bfc1161</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;well, without going any furtyher, I have done it extensively using the &amp;quot;switch&amp;quot; statement.&lt;br /&gt;
&lt;br /&gt;
Erik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>