OSDN Git Service

[UI][v2.0] Configurable update-time.Backport from v1.0.
[openi2cradio/OpenI2CRadio.git] / menu_setup.c
index 77352cc..61a8ea0 100644 (file)
@@ -70,48 +70,62 @@ void setup_menu(void)
 {
     unsigned char c;
     unsigned long val;
+    unsigned int val2;
 
     c = printhelp_2lines("Setup F=HELP", "5=Return");
     _CLS();
    // _LOCATE(0,0);
     switch(c){
         case charcode_1:
-                list_userband();
-                break;
+            list_userband();
+            break;
         case charcode_3:
             printstr("BL Level:");
             val = read_numeric(setup.backlight_level, 3, 0,1);
             if((val & 0x80000000) == 0) {
-                if(val > 255) val = 255;
-                if(val < 15) val = 15;
-                setup.backlight_level = (unsigned char)val;
+                val2 = val;
+                if(val2 > 255) val2 = 255;
+                if(val2 < 15) val2 = 15;
+                setup.backlight_level = (unsigned char)val2;
             }
             break;
         case charcode_4:
             printstr("FM Bandwidth:");
 //            c = akc6955_get_fmbandwidth();
-            setup.fmbandwidth = pollkey_numeric(0) & 3;
+            setup.fmbandwidth = pollkey_numeric(0);
             akc6955_set_fmbandwidth(setup.fmbandwidth);
             break;
         case charcode_5:
             break;
+       case charcode_6:
+           printstr("UI Update:");
+           val = read_numeric(setup.ui_idlecount, 4, 0, 1);
+           if((val & 0x80000000) == 0) {
+              val2 = val;
+               if(val2 < 100) val2 = 100;
+               if(val2 > 5000) val2 = 5000;
+               setup.ui_idlecount = val2;
+              ui_idlekey = val2 / 92; // 23*4
+              ui_idlepad = val2 % 23;
+           } 
+            break;
         case charcode_7:
             printstr("FM-CNR:");
             c = setup.threshold_fmcnr;
             c = pollkey_numeric(c);
-            akc6955_set_thresh_fmcnr(c & 3);
+            akc6955_set_thresh_fmcnr(c);
             break;
         case charcode_8:
             printstr("AM-CNR:");
             c = setup.threshold_amcnr;
             c = pollkey_numeric(c);
-            akc6955_set_thresh_amcnr(c & 3);
+            akc6955_set_thresh_amcnr(c);
             break;
         case charcode_9:
             printstr("Stereo th:");
             c  = setup.threshold_fmstereo;
             c = pollkey_numeric(c);
-            akc6955_set_thresh_fmstereo(c & 3);
+            akc6955_set_thresh_fmstereo(c);
             break;
         case charcode_0:
             menu_poweroff();
@@ -129,8 +143,9 @@ void setup_menu(void)
             printstr("BL Long:");
             val = read_numeric(setup.backlight_long, 3, 0,1);
             if((val & 0x80000000) == 0) {
-                if(val > 999) val = 999;
-                setup.backlight_long = val;
+                val2 = val;
+                if(val2 > 999) val2 = 999;
+                setup.backlight_long = val2;
             }
             break;
         case charcode_f: