OSDN Git Service

[UI][TUNE] Set correct MODE_3K.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 27 Sep 2013 16:54:33 +0000 (01:54 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 27 Sep 2013 16:54:33 +0000 (01:54 +0900)
akc6955.c
menu.c
ui_display.c
ui_updown.c

index 0a2330e..18f99cd 100644 (file)
--- a/akc6955.c
+++ b/akc6955.c
@@ -212,7 +212,7 @@ void akc6955_set_tune(unsigned char mode_3k, unsigned int ch)
             start = userband.am_usrbands[setup.am_userbandnum].start * 32;
             stop = userband.am_usrbands[setup.am_userbandnum].stop * 32;
         } else {
-            if((mode_3k != 0) || (band == AKC6955_BAND_MW2) || (band == AKC6955_BAND_LW)) {
+            if(mode_3k != 0) {
                 q = 3;
             } else {
                 q = 5;
@@ -372,8 +372,10 @@ void akc6955_set_freq(unsigned int freq)
         mode3k.byte = akc6955_readcmd(AKC6955_CNR_AM);
         if((band == AKC6955_BAND_MW2) || (band == AKC6955_BAND_LW) || (mode3k.b7)){
             q = 3;
+            mode3k.b7 = 1;
         } else {
             q = 5;
+            mode3k.b7 = 0;
         }
         ch = freq / q;
     }
diff --git a/menu.c b/menu.c
index f498458..d965604 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -156,6 +156,7 @@ void setband_direct(void)
             mode3k = 0x00;
           break;
        }
+        akc6955_mode3k(mode3k);
         akc6955_set_amband(band);
         setup.amfreq = freq;
         setup.am_mode3k = mode3k;
index 371246b..72005a3 100644 (file)
@@ -127,15 +127,15 @@ void update_display(void)
     _LOCATE(0,0);
     printstr("S");
     if(recv_signal > 99){
-        printstr("9+");
+        _PUTCHAR('+');
     } else {
-        print_numeric_nosupress(recv_signal, 2);
+        _PUTCHAR('0' + recv_signal / 10);
     }
     _PUTCHAR('/');
-    if(cnrlevel > 99) {
-        printstr("++");
+    if(cnrlevel >= 40) {
+        _PUTCHAR('+');
     } else {
-        print_numeric_nosupress(cnrlevel, 2);
+        _PUTCHAR('0' + cnrlevel / 4);
     }
     _PUTCHAR(' ');
     set_amfmlamp(~setup.fm);
index 1c484bf..237f4bd 100644 (file)
@@ -62,6 +62,7 @@ static void setfreq_updown_amsub(void)
     setup.amfreq = setup.amfreq_bank[setup.amband];
 //    idle_time_62_5ms(); // 62.5ms
     ClrWdt();
+    akc6955_mode3k(setup.am_mode3k);
     akc6955_set_freq(setup.amfreq);
 }
 
@@ -98,15 +99,11 @@ static void setband_updown(unsigned char updown)
         case AKC6955_BAND_MW2:
           setup.am_mode3k = 0xff;
           break;
-        case AKC6955_BAND_MW1:
-        case AKC6955_BAND_MW3:
-        case AKC6955_BAND_MW4:
-          setup.am_mode3k = 0x00;
-          break;
         case AKC6955_BAND_AMUSER:
            call_userband(setup.am_userbandnum);
           break;
         default:
+          setup.am_mode3k = 0x00;
           break;
        }
         setfreq_updown_amsub();