From d72cb57059e15a32d779e96e240a85458380ab9f Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 5 Feb 2013 19:31:47 +0000 Subject: beacon is now continous printing current freq in MHz git-svn-id: https://svn.spreadspace.org/mur.sat@665 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/hhd70dongle/hhd70dongle.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c index 34635a4..ff85ab8 100644 --- a/software/hhd70dongle/hhd70dongle.c +++ b/software/hhd70dongle/hhd70dongle.c @@ -142,6 +142,20 @@ void print_part_status(void) //char cw_wordspace[2] = {0, 7}; //} +void beacon_on(void) +{ + hhd70_palna_txmode(); + hhd70_set_OOK_GDO0_high(); + led_on(); +} + +void beacon_off(void) +{ + led_off(); + hhd70_set_OOK_GDO0_low(); + hhd70_palna_rxmode(); +} + int main(void) { MCUSR &= ~(1 << WDRF); @@ -197,6 +211,9 @@ int main(void) enable_rx_part=false; enable_tx_part=false; c1101_init_ook_beacon(); + + c1101_spi_strobe_command(SPIC1101_ADDR_STX); + beacon_on(); } print_part_status(); } @@ -282,12 +299,21 @@ int main(void) } if (change_freq != 0) { - sprintf(write_buffer,"Frequency %s by %lu KHz\r\n", (change_freq > 0 ? "up" : "down"), (change_freq > 0 ? 1 : -1) * change_freq / 1000); + beacon_off(); + c1101_spi_strobe_command(SPIC1101_ADDR_SIDLE); + + sprintf(write_buffer,"Frequency %s by %lu KHz - ", (change_freq > 0 ? "up" : "down"), (change_freq > 0 ? 1 : -1) * change_freq / 1000); CDC_Device_SendString(&VirtualSerial_CDC_Interface, write_buffer); c1101_changeFrequencyByRelativeValue(change_freq); prev_ook_freq = c1101_getCurrentCarrierFrequencyHz(); + + c1101_spi_strobe_command(SPIC1101_ADDR_STX); + beacon_on(); } - sprintf(write_buffer,"Frequency is now: %lu Hz\r\n", c1101_getCurrentCarrierFrequencyHz()); + uint32_t hz = c1101_getCurrentCarrierFrequencyHz(); + uint16_t mhz = hz / 1000000; + uint16_t khz = (hz % 1000000)/1000; + sprintf(write_buffer,"Frequency is now: %d.%03d MHz\r\n", mhz, khz); CDC_Device_SendString(&VirtualSerial_CDC_Interface, write_buffer); } } @@ -375,7 +401,7 @@ int main(void) led_off(); } - if (enable_beacon_part) +/* if (enable_beacon_part) { //char mursat_beacon[8] = {0b11101110, 0b11100010, 0b00111010, 0b10101000, 0b10001110, 0b11101110, 0b00101011, 0b10100000}; //OE6EOF CDC_Device_SendString(&VirtualSerial_CDC_Interface,"OOK Sending Beacon\r\n"); @@ -390,6 +416,6 @@ int main(void) c1101_spi_strobe_command(SPIC1101_ADDR_SIDLE); hhd70_palna_rxmode(); _delay_ms(200); - } + }*/ } } -- cgit v1.2.3