summaryrefslogtreecommitdiff
path: root/software/rda1846dongle/rda1846dongle.c
diff options
context:
space:
mode:
Diffstat (limited to 'software/rda1846dongle/rda1846dongle.c')
-rw-r--r--software/rda1846dongle/rda1846dongle.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/software/rda1846dongle/rda1846dongle.c b/software/rda1846dongle/rda1846dongle.c
index 8316d62..e058c9d 100644
--- a/software/rda1846dongle/rda1846dongle.c
+++ b/software/rda1846dongle/rda1846dongle.c
@@ -43,7 +43,8 @@
#include "rda1846.h"
#include "rda1846_defines.h"
-#define DEFAULT_FREQ_2M 145900
+#define DEFAULT_FREQ_2M 145000
+#define DEFAULT_FREQ_1M5 230000
#define DEFAULT_FREQ_70CM 435000
int32_t default_freq = DEFAULT_FREQ_2M;
int32_t current_freq_kHz = DEFAULT_FREQ_2M;
@@ -92,21 +93,30 @@ static void update_current_freq(void)
rda1846_idle();
if(rda1846_set_freq_kHz(current_freq_kHz))
- printf("error\r\n");
+ printf("error .. ");
else
- printf("ok\r\n");
+ printf("ok .. ");
if(old_state == receive)
rda1846_receive();
else if(old_state == transmit)
rda1846_transmit();
+
+ if(current_freq_kHz != rda1846_get_freq_kHz()) {
+ printf("NACK!\r\n");
+ print_actual_freq();
+ } else {
+ printf("ACK\r\n");
+ }
}
static void set_band(rf_band_t b)
{
printf("setting band to %s\r\n", rda1846_rf_band_to_string(b));
rda1846_set_band(b);
- default_freq = b == b_2m ? DEFAULT_FREQ_2M : DEFAULT_FREQ_70CM;
+ if(b == b_2m) default_freq = DEFAULT_FREQ_2M;
+ else if(b == b_1m5) default_freq = DEFAULT_FREQ_1M5;
+ else if(b == b_70cm) default_freq = DEFAULT_FREQ_70CM;
set_default_freq();
}
@@ -167,12 +177,18 @@ static void handle_cmd(uint8_t cmd)
case 'i': reinit_rda(); break;
case '2': set_band(b_2m); break;
+ case '3': set_band(b_1m5); break;
case '7': set_band(b_70cm); break;
case 'b': set_bw(bw_12k5); break;
case 'B': set_bw(bw_25k); break;
case 'F': set_default_freq(); break;
- case '+': current_freq_kHz+=25; update_current_freq(); break;
- case '-': current_freq_kHz-=25; update_current_freq(); break;
+
+ case '#': current_freq_kHz+=100; update_current_freq(); break;
+ case '+': current_freq_kHz+=10; update_current_freq(); break;
+ case ':': current_freq_kHz+=1; update_current_freq(); break;
+ case '.': current_freq_kHz-=1; update_current_freq(); break;
+ case '-': current_freq_kHz-=10; update_current_freq(); break;
+ case '_': current_freq_kHz-=100; update_current_freq(); break;
case 'P': rda1846_powerdown(); print_status(); break;
case 'I': rda1846_idle(); print_status(); break;