OSDN Git Service

[LCD] Use LCD_I2CADDR in lcd_acm1602.h.
[openi2cradio/OpenI2CRadio.git] / menu_memoryfreq.c
index 0cadf42..50fd912 100644 (file)
@@ -30,7 +30,7 @@
 #include "power.h"
 #include "commondef.h"
 #include "eeprom.h"
-
+#include "backlight.h"
 
 void call_freqbank(unsigned int num)
 {
@@ -135,8 +135,8 @@ void on_updown_userfreq(void)
     unsigned char _fm;
     unsigned char _band;
     unsigned char _userband;
-    unsigned char n;
     unsigned char c;
+    unsigned char dispf = 0xff;
 
     _fm = setup.fm;
     _freq = setup.amfreq;
@@ -150,14 +150,19 @@ void on_updown_userfreq(void)
 
     _CLS();
     do {
-        _LOCATE(0,0);
-        printstr("CH:");
-        print_numeric_nosupress(setup.memorynum, 3);
-        printstr(" 8/2/A");
-        update_status();
-        print_freq(1);
-        _HOME();
-        c = pollkey_single_timeout(44, 1); // About 1s
+       if(dispf != 0)  {
+            _LOCATE(0,0);
+            printstr("CH:");
+            print_numeric_nosupress(setup.memorynum, 3);
+            printstr(" 8/2/A");
+            update_status();
+            print_freq(1);
+            _HOME();
+       }
+       c = pollkey_single_timeout(41, 1); // 23*41 = 943ms
+       backlight_reset(c);
+       dispf = backlight_dec(dispf);
+
        switch(c) {
            case charcode_7: // UP 1CH
                 setup.memorynum++;
@@ -184,14 +189,14 @@ void on_updown_userfreq(void)
                }
                call_freqbank(setup.memorynum);
                break;
-           case charcode_8: // Up CH FAST
+           case charcode_8: // Up CH MID
                setup.memorynum += USER_MEMORY_NUM;
                if(setup.memorynum >= (USER_MEMORY_NUM * USER_MEMORY_BANKS)) {
                     setup.memorynum = setup.memorynum - USER_MEMORY_NUM * USER_MEMORY_BANKS;
                }
                call_freqbank(setup.memorynum);
                break;
-           case charcode_2: // Down CH FAST
+           case charcode_2: // Down CH MID
                if(setup.memorynum < USER_MEMORY_NUM) {
                     setup.memorynum = (USER_MEMORY_NUM * USER_MEMORY_BANKS) - USER_MEMORY_NUM + setup.memorynum;
                } else {
@@ -199,7 +204,10 @@ void on_updown_userfreq(void)
                }
                call_freqbank(setup.memorynum);
                break;
-            case charcode_5: // Reset
+            case charcode_5: // Recall
+               call_freqbank(setup.memorynum);
+               break;
+            case charcode_d: // Reset
                if(_fm) { // AM
                     setup.fmband = _band;
                     setup.fm_userbandnum = _userband;
@@ -220,10 +228,11 @@ void on_updown_userfreq(void)
            case charcode_a:
                 goto _l0;
                 break;
+           case charcode_e: // Set Light
            default:
                break;
            }
-//       _HOME();
+            idle_time_ms(9); // Pad 9ms, 1Loop = 1000ms.
     } while(1);
 _l0:
     _CLS();