From eedfe4c31b9d7d2a352d0fd8723db2c04e33fe33 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Sat, 19 May 2012 04:42:03 +0000 Subject: debug code makes code too slow, causing FIFO underrun -> commented out git-svn-id: https://svn.spreadspace.org/mur.sat@435 7de4ea59-55d0-425e-a1af-a3118ea81d4c --- software/hhd70dongle/c1101lib.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) (limited to 'software/hhd70dongle/c1101lib.c') diff --git a/software/hhd70dongle/c1101lib.c b/software/hhd70dongle/c1101lib.c index 06c825c..0578099 100644 --- a/software/hhd70dongle/c1101lib.c +++ b/software/hhd70dongle/c1101lib.c @@ -161,9 +161,9 @@ int spi_c1101_write_txfifo(char *buffer, int len) uint8_t debug_sb[6]; while (len-- > 0 && SPIC1101_SB_FIFO_BYTES_AVAILABLE(sb) > 2) { - usb_rawhid_send((uint8_t*)"TXFifo bytes available",255); - debug_sprint_int16hex(debug_sb, SPIC1101_SB_FIFO_BYTES_AVAILABLE(sb)); - usb_rawhid_send(debug_sb,255); + //~ usb_rawhid_send((uint8_t*)"TXFifo bytes available",255); + //~ debug_sprint_int16hex(debug_sb, SPIC1101_SB_FIFO_BYTES_AVAILABLE(sb)); + //~ usb_rawhid_send(debug_sb,255); sb = spi_c1101_write_byte_ok_get_status(buffer[num_written++]); } spi_cs_disable(); @@ -377,30 +377,28 @@ void c1101_transmitData(char *buffer, unsigned int len) uint8_t c1101_state=0; do { + c1101_getStatus(); + num_written = spi_c1101_write_txfifo(buffer, len ); + buffer += num_written; + len -= num_written; c1101_state = c1101_getMARCState(); if (c1101_state == 1) { //from idle state, go to RX state num_written = spi_c1101_strobe_command(SPIC1101_ADDR_STX); - usb_rawhid_send((uint8_t*)"Strobe STX",255); - debug_sprint_int16hex(debug_sb, num_written); - usb_rawhid_send(debug_sb,255); + //~ usb_rawhid_send((uint8_t*)"Strobe STX",255); + //~ debug_sprint_int16hex(debug_sb, num_written); + //~ usb_rawhid_send(debug_sb,255); } - - c1101_getStatus(); - num_written = spi_c1101_write_txfifo(buffer, len ); - buffer += num_written; - len -= num_written; - - usb_rawhid_send((uint8_t*)"TX2 num written",255); - debug_sprint_int16hex(debug_sb, num_written); - usb_rawhid_send(debug_sb,255); - usb_rawhid_send((uint8_t*)"TX2 len",255); - debug_sprint_int16hex(debug_sb, len); - usb_rawhid_send(debug_sb,255); - usb_rawhid_send((uint8_t*)"TX2 bytes",255); - debug_sprint_int16hex(debug_sb, c1101_getNumBytesInTXFifo()); - usb_rawhid_send(debug_sb,255); + //~ usb_rawhid_send((uint8_t*)"TX2 num written",255); + //~ debug_sprint_int16hex(debug_sb, num_written); + //~ usb_rawhid_send(debug_sb,255); + //~ usb_rawhid_send((uint8_t*)"TX2 len",255); + //~ debug_sprint_int16hex(debug_sb, len); + //~ usb_rawhid_send(debug_sb,255); + //~ usb_rawhid_send((uint8_t*)"TX2 bytes",255); + //~ debug_sprint_int16hex(debug_sb, c1101_getNumBytesInTXFifo()); + //~ usb_rawhid_send(debug_sb,255); } while (len > 0); } -- cgit v1.2.3