summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--software/hhd70dongle/c1101lib.c40
-rw-r--r--software/hhd70dongle/hhd70dongle.c2
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')