OSDN Git Service

[Menu] Remove tedious function calls.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sat, 31 Aug 2013 13:35:57 +0000 (22:35 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sat, 31 Aug 2013 13:35:57 +0000 (22:35 +0900)
menu.c
nbproject/Makefile-genesis.properties

diff --git a/menu.c b/menu.c
index 5778e01..11f3f9c 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -184,7 +184,6 @@ void scan_start(void)
             print_freq(1);
             _HOME();
         } while(c == charcode_null);
-       // c = pollkeybuf[0];
       // New Scan
        switch(c){
            case charcode_6:
@@ -392,37 +391,33 @@ void input_userband(void)
 {
     unsigned char c;
     do{
-    _CLS();
-    _LOCATE(0,0);
-    printstr("User Band");
-    _LOCATE(0,1);
-    printstr("   #");
-    c = pollkey_single();
+      c = printhelp_2lines("User Band", "   #");
 
-    if((c >= charcode_a) && (c <= charcode_f)){
-        break;
-    }
-    if(c == charcode_0) {
-        _PUTCHAR('0');
-        if(setup.fm != 0){
-           setup.fm_userbandnum = 0;
-        } else {
-           setup.am_userbandnum = 0;
-        }
-        call_userband(0);
-    } else {
-        c = c - charcode_1 + 1;
-        if(c < USER_BAND_NUM) {
-            _PUTCHAR(c + '0');
-            if(setup.fm != 0){
+
+       if((c >= charcode_a) && (c <= charcode_f)){
+         break;
+       }
+       if(c == charcode_0) {
+         _PUTCHAR('0');
+         if(setup.fm != 0){
+            setup.fm_userbandnum = 0;
+         } else {
+            setup.am_userbandnum = 0;
+         }
+         call_userband(0);
+       } else {
+         c = c - charcode_1 + 1;
+         if(c < USER_BAND_NUM) {
+            _PUTCHAR(c + '0');
+            if(setup.fm != 0){
                setup.fm_userbandnum = c;
             } else {
-                setup.am_userbandnum = c;
+               setup.am_userbandnum = c;
             }
             call_userband(c);
         }
-    }
-    idle(setup.ui_idlecount);
+       }
+       idle(setup.ui_idlecount);
     } while(1);
     _CLS();
 }
@@ -582,12 +577,7 @@ void main_menu(void)
     unsigned char c;
     unsigned int val;
 
-    _CLS();
-    _HOME();
-    _LOCATE(0,0);
-    printstr("Menu:F=HELP");
-    _LOCATE(0,1);
-    printstr("B=CANCEL");
+    printhelp_2lines("Menu:F=HELP", "B=CANCEL");
     c = pollkey_single(); // 1012ms
         if(c == charcode_1){
             // Band
index f22cafd..7d94e28 100644 (file)
@@ -1,5 +1,5 @@
 #
-#Sat Aug 31 21:36:22 JST 2013
+#Sat Aug 31 22:01:07 JST 2013
 default.languagetoolchain.dir=/opt/microchip/xc8/v1.20/bin
 com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=1c49f19f6a43b876c317e0d8d41c0854
 default.languagetoolchain.version=1.20