From 44dda8f30750d0cb2915e9cfadec4798caf88e0c Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 17 Feb 2015 16:08:29 +0100 Subject: hhd70: reading state works now --- software/hhd70dongle/hhd70dongle.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'software/hhd70dongle') 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; -- cgit v1.2.3