diff options
author | Christian Pointner <equinox@mur.at> | 2013-03-21 02:31:10 +0000 |
---|---|---|
committer | Christian Pointner <equinox@mur.at> | 2013-03-21 02:31:10 +0000 |
commit | a5d9e5e231f3e1e2946a7c2b849e60e7dadef6e3 (patch) | |
tree | 8fac589a88d5e76dec5a595b61fca7e843f0a200 /software/rda1846dongle/rda1846dongle.c | |
parent | parts of rda1846dongle working (diff) |
first working receive
git-svn-id: https://svn.spreadspace.org/mur.sat@703 7de4ea59-55d0-425e-a1af-a3118ea81d4c
Diffstat (limited to 'software/rda1846dongle/rda1846dongle.c')
-rw-r--r-- | software/rda1846dongle/rda1846dongle.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/software/rda1846dongle/rda1846dongle.c b/software/rda1846dongle/rda1846dongle.c index ebb97de..757356d 100644 --- a/software/rda1846dongle/rda1846dongle.c +++ b/software/rda1846dongle/rda1846dongle.c @@ -88,10 +88,12 @@ static void update_current_freq(void) static void print_status(void) { int16_t rssi = rda1846_get_rssi(); - if(rssi < 0) - printf("rssi: NaN dB\r\n"); - else - printf("rssi: %d.%03d dB\r\n", (uint16_t)(rssi / 8), (uint16_t)((rssi % 8)*125)); + printf("rssi: "); + if(rssi < 0) { + printf("-"); + rssi*=-1; + } + printf("%d.%03d dB\r\n", (uint16_t)(rssi / 8), (uint16_t)((rssi % 8)*125)); int16_t vssi = rda1846_get_vssi(); if(vssi < 0) @@ -121,13 +123,18 @@ static void print_dtmf(void) static void handle_cmd(uint8_t cmd) { switch(cmd) { - case '0': led_off(); printf("led OFF\r\n"); break; - case '1': led_on(); printf("led ON\r\n"); break; + case '0': rda1846_gpio_AA(); led_off(); printf("led OFF\r\n"); break; + case '1': rda1846_gpio_55(); led_on(); printf("led ON\r\n"); break; case 't': led_toggle(); printf("led TOGGLE\r\n"); break; case '!': reset2bootloader(); break; + case 'r': rda1846_soft_reset(); printf("soft resetting RDA1846.\r\n"); break; case 'i': rda1846_init(); printf("initializing RDA1846.\r\n"); break; case 'F': set_default_freq(); break; + + case 'g': rda1846_gpio_off(); printf("GPIO off\r\n"); break; + case 'G': rda1846_gpio_default(); printf("GPIO to defaults\r\n"); break; + case 'f': print_actual_freq(); break; case 's': print_status(); break; case 'd': print_dtmf(); break; @@ -135,6 +142,7 @@ static void handle_cmd(uint8_t cmd) case 'p': rda1846_powerdown(); break; case 'P': rda1846_wakeup(); break; + case 'I': rda1846_idle(); break; case 'R': rda1846_receive(); break; case 'T': rda1846_transmit(); break; |