OSDN Git Service

[v1.0][Doc] v1.0(.0) Release.
[openi2cradio/OpenI2CRadio.git] / helps.c
diff --git a/helps.c b/helps.c
index 657078a..ee60369 100644 (file)
--- a/helps.c
+++ b/helps.c
 #include "menu.h"
 #include "power.h"
 #include "commondef.h"
+#if 0
+const char *userfreq_helpstr[16] = {
+#else
+const char *userfreq_helpstr[10] = {
+#endif
+       "5: Reload", " ",
+        "1: -1", "7: +1",
+        "4: Call direct", "6: Set",
+#if 0
+        "2: -28", "8: +28",
+        "3: -100", "9: +100",
+#endif
+        "A: Exit",  "D: Reset",
+        "E: Backlight", "F: (Exit) Help",
+    };
 
-const char *updown_helpstr[20] = {
-        "Help", "F=exit any=continue",
-        "5: Menu", " ",
+const char *updown_helpstr[16] = {
+        "5: Menu", "0: Narrow/Broad",
         "1: Slow Down", "3: Slow Up",
         "4: Down", "6: Up",
         "7: Fast Down", "9: Fast Up",
         "2: Band Down", "8: Band Up",
-        "0: Mode3K", " ",
-        "a: AM/FM", "b: Volume",
-        "c: Scan", "d: Stereo mode",
-        "e: Backlight", "f: (Exit) Help",
+        "A: AM/FM", "B: User freq",
+        "C Scan", "D: Stereo mode",
+        "E: Backlight", "F: (Exit) Help",
     };
 
-const char *setup_helpstr[16] = {
-        "Help", "F=exit any=continue",
-        "0: Power OFF", "C: Save status",
-        "d: Reset default", "E: BL time",
-        "A: Load", "",
-        "1: FM CNR", "2: AM CNR"
-        "3: FM STEREO", "4: Reserve"
-        "6: Reserve", "7: Reserve",
-        "8: Reserve", "9: Reserve",
+const char *setup_helpstr[14] = {
+        "0: Power OFF",  "6: UI Update ",
+        "3: BL Level", "E: BL time",
+        "A: Load", "D: Reset default",
+        "C: Save status", " ",
+        "7: FM CNR", "8: AM CNR"
+        "9: FM STEREO", "4: FM BW",
         "5: Cancel", "f: (Exit) Help",
     };
 
-const char *mainmenu_helpstr[18] = {
-        "Help", "F=exit any=continue",
+const char *mainmenu_helpstr[16] = {
         "0: Setup", "1: Band",
-        "2: Reserve", "3: Freq",
-        "4: Reserve", "5: Scan"
-        "6: Reserve", "7: Power Off",
-        "8: Reserve", "9: Width",
-        "a: AM/FM", "b: Cancel",
-        "c: Set user", "d: Input user",
-        "e: Reserve", "f: (Exit) Help"
+        "2:Resv" , "3: Freq",
+        "4: Call user", "6: Set user",
+        "7: Power Off", "8: Volume",
+        "9: Reload", "A: AM/FM",
+        "B: Cancel","C: Set user",
+        "D: Input user","E: FM PITCH",
+        " ", "F: (Exit) Help",
+};
+
+const char *numeric_helpstr[8] = {
+     "On numeric", " input",
+    "0-9: Numeric", "F: Enter",
+    "A: Delete", "B: Reset value",
+    "D: Left", "E: Right",
 };
 
-const char *numeric_helpstr[10] = {
-     "On numeric input", " ",
-    "0-9: Numeric", "f: enter",
-    "a: Delete", "b: Reset value",
-    "d: Left", "e: Right",
-    "Press any key", " to continue."
+
+const char *version_helpstr[8] = {
+    "Open I2C Radio", "V1.00",
+    "(C) 2013", "Kyuma Ohta",
+    "Licensed under", "GPLv2+LE",
+    "Press any key", " to continue.",
 };
 
+static unsigned char help_header(void)
+{
+    return printhelp_2lines("Help", "F=exit any=continue");
+}
+
+static unsigned char help_version(void)
+{
+    unsigned char c;
+    unsigned char i;
+    for(i = 0; i < 8; i += 2){
+        c = printhelp_2lines(version_helpstr[i], version_helpstr[i + 1]);
+        if(c == charcode_f) return c;
+    }
+    return help_header();
+}
 
 void setup_help(void)
 {
     unsigned char c;
     char l;
     l = 0;
+    if(help_header() == charcode_f) return;
     do {
         c = printhelp_2lines(setup_helpstr[l], setup_helpstr[l + 1]);
         if(c == charcode_f) return;
         l += 2;
-        if(l >= 16) {
+        if(l >= 14) {
             c = numeric_help();
             if(c == charcode_f) return;
+            if(help_version() == charcode_f) return;
             l = 0;
         }
     } while(1);
 
 }
 
-unsigned char printhelp_2lines(char *l1, char *l2)
+unsigned char printhelp_2lines(const char *l1, const char *l2)
 {
     _CLS();
-    _LOCATE(0,0);
+    //_LOCATE(0,0);
     printstr(l1);
-    _LOCATE(0,1);
+    _LOCATE_0_1();
     printstr(l2);
     _HOME();
     return pollkey_single();
@@ -114,7 +148,7 @@ unsigned char numeric_help(void)
         c = printhelp_2lines(numeric_helpstr[l], numeric_helpstr[l + 1]);
         if(c == charcode_f) return charcode_f;
         l += 2;
-    } while(l < 10);
+    } while(l < 8);
     return c;
 }
 
@@ -124,13 +158,15 @@ void mainmenu_help(void)
 
     char l;
     l = 0;
+    if(help_header() == charcode_f) return;
     do {
         c = printhelp_2lines(mainmenu_helpstr[l], mainmenu_helpstr[l + 1]);
         if(c == charcode_f) return;
         l += 2;
-        if(l >= 18) {
+        if(l >= 16) {
             c = numeric_help();
             if(c == charcode_f) return;
+            if(help_version() == charcode_f) return;
             l = 0;
         }
     } while(1);
@@ -142,14 +178,39 @@ void updown_help(void)
     char l;
 
     l = 0;
+    if(help_header() == charcode_f) return;
     do {
         c = printhelp_2lines(updown_helpstr[l], updown_helpstr[l + 1]);
         if(c == charcode_f) return;
         l += 2;
-        if(l >= 20) {
+        if(l >= 16) {
             c = numeric_help();
             if(c == charcode_f) return;
+            if(help_version() == charcode_f) return;
             l = 0;
         }
     } while(1);
 }
+
+
+void userfreq_help(void)
+{
+    unsigned char c;
+    char l;
+
+    l = 0;
+    if(help_header() == charcode_f) return;
+    do {
+        c = printhelp_2lines(userfreq_helpstr[l], userfreq_helpstr[l + 1]);
+        if(c == charcode_f) return;
+        l += 2;
+        if(l >= 10) {
+            c = numeric_help();
+            if(c == charcode_f) return;
+            if(help_version() == charcode_f) return;
+            l = 0;
+        }
+    } while(1);
+}
+
+