diff options
author | Bernhard Tittelbach <xro@realraum.at> | 2012-05-19 04:42:03 +0000 |
---|---|---|
committer | Bernhard Tittelbach <xro@realraum.at> | 2012-05-19 04:42:03 +0000 |
commit | eedfe4c31b9d7d2a352d0fd8723db2c04e33fe33 (patch) | |
tree | 8d93f658615040c34eb8d6ed394b883b083626bf | |
parent | variable packet mode works, where infinite packet mode apparently doesn't (diff) |
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
-rw-r--r-- | software/hhd70dongle/c1101lib.c | 40 | ||||
-rw-r--r-- | software/hhd70dongle/hhd70dongle.c | 2 |
2 files changed, 20 insertions, 22 deletions
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); } diff --git a/software/hhd70dongle/hhd70dongle.c b/software/hhd70dongle/hhd70dongle.c index 97b82a5..3e64c4f 100644 --- a/software/hhd70dongle/hhd70dongle.c +++ b/software/hhd70dongle/hhd70dongle.c @@ -74,7 +74,7 @@ int main(void) for(;;) { - _delay_ms(250); + _delay_ms(1000); led_toggle(); usb_rawhid_recv(read_buffer,20); if (read_buffer[0] == 'r') |