OSDN Git Service

[UI][HELP] Update help of setup.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 27 Sep 2013 18:26:33 +0000 (03:26 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 27 Sep 2013 18:26:33 +0000 (03:26 +0900)
akc6955.c
helps.c
menu.h
menu_setup.c
menu_userband.c
ui.c

index 18f99cd..774d3bf 100644 (file)
--- a/akc6955.c
+++ b/akc6955.c
@@ -418,7 +418,7 @@ int akc6955_read_level(void)
     unsigned char rflevel, iflevel;
     unsigned char b;
     int rssi;
-    unsigned int freq;
+    unsigned char band;
     int totallevel;
     int level;
 
@@ -433,10 +433,10 @@ int akc6955_read_level(void)
     if(f != 0){
         level = 103 - level; // totallevel * 6
     } else {
-        freq = akc6955_get_freq();
-        if(freq > 2560) { // ASSUME SW
+        band = akc6955_get_amband();
+        if((band >= AKC6955_BAND_SW1) && (band <= AKC6955_BAND_AMUSER)) { // SW
             level = 103 - level;
-        } else { // ASSUME MW,LW
+        } else { //  MW,LW
             level = 123 - level;
         }
     }
diff --git a/helps.c b/helps.c
index 2509c92..d5b7bb5 100644 (file)
--- a/helps.c
+++ b/helps.c
@@ -58,13 +58,13 @@ const char *updown_helpstr[16] = {
     };
 
 const char *setup_helpstr[14] = {
-        "0: Power OFF",  " ",
+        "0: Power OFF",  "1: List userband",
         "3: BL Level", "E: BL time",
         "A: Load", "D: Reset default",
-        "C: Save status", " ",
-        "7: FM CNR", "8: AM CNR"
+        "C: Save status", "6: ",
+        "7: FM CNR", "8: AM CNR",
         "9: FM STEREO", "4: FM BW",
-        "5: Cancel", "f: (Exit) Help",
+        "5: Cancel", "F: (Exit) Help",
     };
 
 const char *mainmenu_helpstr[16] = {
diff --git a/menu.h b/menu.h
index ce3a0d7..ce7a2fe 100644 (file)
--- a/menu.h
+++ b/menu.h
@@ -161,6 +161,7 @@ typedef struct {
     extern void input_userband(void);
     extern void set_userband(void);
     extern void call_userband(unsigned char num);
+    extern void list_userband(void);
 
     /*
      * menu_scan.c
index 7668cbb..12e4880 100644 (file)
@@ -75,6 +75,9 @@ void setup_menu(void)
     _CLS();
     _LOCATE(0,0);
     switch(c){
+        case charcode_1:
+                list_userband();
+                break;
         case charcode_3:
             printstr("BL Level:");
             val = read_numeric(setup.backlight_level, 3, 0,1);
@@ -86,8 +89,8 @@ void setup_menu(void)
             break;
         case charcode_4:
             printstr("FM Bandwidth:");
-            c = akc6955_get_fmbandwidth();
-            setup.fmbandwidth = pollkey_numeric(c) & 3;
+//            c = akc6955_get_fmbandwidth();
+            setup.fmbandwidth = pollkey_numeric(0) & 3;
             akc6955_set_fmbandwidth(setup.fmbandwidth);
             break;
         case charcode_5:
index 3cb9133..e34b34c 100644 (file)
@@ -86,7 +86,7 @@ void set_userband(void)
     c = 0;
     printstr("User ch:");
     c = pollkey_numeric(c);
-    if(c >= USER_BAND_NUM) return;
+    if(c >= USER_BAND_NUM) goto _l0;
 
     if(fm != 0){
         from = userband.fm_usrbands[c].start * 80 + 3000; // 32*25/10
@@ -216,3 +216,41 @@ _l0:
     _CLS();
 }
 
+void list_userband(void)
+{
+    unsigned char i;
+    unsigned char q;
+    unsigned char c;
+
+    for(i = 0; i < USER_BAND_NUM; i ++){
+        _CLS();
+        printstr("FM#");
+        _PUTCHAR('0' + i);
+        _LOCATE(0,1);
+        print_numeric_nosupress(userband.fm_usrbands[i].start * 80 + 3000, 5);
+        printstr(" to ");
+        print_numeric_nosupress(userband.fm_usrbands[i].stop * 80 + 3000, 5);
+        c = pollkey_single();
+        if(c == charcode_a) {
+            return;
+        }
+    }
+    for(i = 0; i < USER_BAND_NUM; i ++){
+        _CLS();
+        printstr("AM#");
+        _PUTCHAR('0' + i);
+        _LOCATE(0,1);
+        if(userband.am_usrbands[i].mode3k != 0){
+            q = 3 * 32;
+        } else {
+            q = 5 * 32;
+        }
+        print_numeric_nosupress(userband.am_usrbands[i].start * q, 5);
+        printstr(" to ");
+        print_numeric_nosupress(userband.am_usrbands[i].stop *  q, 5);
+        c = pollkey_single();
+        if(c == charcode_a) {
+            return;
+        }
+    }
+}
\ No newline at end of file
diff --git a/ui.c b/ui.c
index cd5bba0..ed89abd 100644 (file)
--- a/ui.c
+++ b/ui.c
@@ -351,6 +351,7 @@ unsigned char pollkey_single(void)
 unsigned char pollkey_numeric(unsigned char init)
 {
     unsigned char c;
+    _PUTCHAR('0' + init);
     c = pollkey_single();
     if(c == charcode_0) {
         return 0;