OSDN Git Service

[SCHEMATIC] Modify SW/MW/LW Preamp, insert galbanic-isolator replace of common-mode...
[openi2cradio/OpenI2CRadio.git] / menu_userband.c
index 3cb9133..06f7dc4 100644 (file)
@@ -82,17 +82,17 @@ void set_userband(void)
     unsigned char fm = setup.fm;
 
     _CLS();
-    _LOCATE(0,0);
+//    _LOCATE(0,0);
     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
         to = userband.fm_usrbands[c].stop * 80 + 3000;
         _CLS();
-        _LOCATE(0,0);
+   //     _LOCATE(0,0);
         printstr("FM#");
         print_numeric_nosupress(c, 1);
     } else {
@@ -102,7 +102,7 @@ void set_userband(void)
         from = userband.am_usrbands[c].start * pp;
         to = userband.am_usrbands[c].stop * pp;
         _CLS();
-        _LOCATE(0,0);
+//        _LOCATE(0,0);
         printstr("AM#");
         print_numeric_nosupress(c, 1);
         printstr(" Step:");
@@ -111,7 +111,7 @@ void set_userband(void)
         } else {
             printstr("3K->");
         }
-        _LOCATE(0,1);
+        _LOCATE_0_1();
         printstr("0=3k 1=5k");
         cc = pollkey_single();
         if(cc == charcode_0){
@@ -123,7 +123,7 @@ void set_userband(void)
         } else {
             goto _l0;
         }
-        _LOCATE(11,0);
+        _LOCATE(10,0);
         if(mode3k == 0){
             printstr("5K  ");
         } else {
@@ -131,11 +131,11 @@ void set_userband(void)
         }
     }
 
-    _LOCATE(0,1);
+    _LOCATE_0_1();
     printstr("From:");
     from = read_numeric(from, 5, 7, 1);
     if((from & 0xffff0000) != 0) goto _l0;
-    _LOCATE(0,1);
+    _LOCATE_0_1();
     printstr("To:  ");
     to = read_numeric(to, 5, 7, 1);
     if((to & 0xffff0000) != 0) goto _l0;
@@ -158,7 +158,7 @@ void set_userband(void)
     _PUTCHAR('#');
     _PUTCHAR('0' + c);
     printstr(" A=OK");
-    _LOCATE(0,1);
+    _LOCATE_0_1();
     print_numeric_nosupress(_from, 5);
     printstr("->");
     print_numeric_nosupress(_to, 5);
@@ -191,7 +191,7 @@ _l0:
 void input_userband(void)
 {
     unsigned char c;
-    char d;
+    int d;
         c = printhelp_2lines("User Band", "   #");
         if((c > charcode_a) && (c <= charcode_f)){
             goto _l0;
@@ -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