summaryrefslogtreecommitdiff
path: root/software/hhd70dongle
diff options
context:
space:
mode:
authorChristian Pointner <equinox@mur.at>2015-02-17 16:08:29 +0100
committerChristian Pointner <equinox@mur.at>2015-02-17 16:08:29 +0100
commit44dda8f30750d0cb2915e9cfadec4798caf88e0c (patch)
tree76b56ffcc1d43a828778795f6d14862572626a45 /software/hhd70dongle
parenthhd70: added idle command (diff)
hhd70: reading state works now
Diffstat (limited to 'software/hhd70dongle')
-rw-r--r--software/hhd70dongle/hhd70dongle.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c
index 482be70..35d2d38 100644
--- a/software/hhd70dongle/hhd70dongle.c
+++ b/software/hhd70dongle/hhd70dongle.c
@@ -59,6 +59,12 @@ static void reinit_hhd70(void)
cc1101_reg_init();
}
+static void powerdown_hhd70(void)
+{
+ printf("sending CC1101 to sleep.\r\n");
+ cc1101_powerdown();
+}
+
static uint32_t print_actual_freq(void)
{
uint32_t f = cc1101_get_freq_hz();
@@ -87,8 +93,7 @@ static void update_current_freq(void)
static void print_status(void)
{
- printf("HHD70 status:\r\n");
- printf(" to be implemented...\r\n");
+ printf("current state: %s\r\n", cc1101_state_to_string(cc1101_get_state()));
}
static void handle_cmd(uint8_t cmd)
@@ -110,7 +115,7 @@ static void handle_cmd(uint8_t cmd)
case '-': current_freq_hz-=10000; update_current_freq(); break;
case '_': current_freq_hz-=100000; update_current_freq(); break;
- case 'P': cc1101_powerdown(); print_status(); break;
+ case 'P': powerdown_hhd70(); break;
case 'I': cc1101_idle(); print_status(); break;
case 'f': print_actual_freq(); break;