Commit aa1b8a8c authored by Joanne Hugé's avatar Joanne Hugé

Fix trx_ecpri_write bug

parent 431bebe4
......@@ -154,7 +154,7 @@ static uint8_t pkt_frame_full[1024];
#endif
static volatile int rx_trace_ready = 0;
static volatile int tx_trace_ready = 1;
static volatile int tx_trace_ready = 0;
static int64_t encode_counter_prev = 0;
static int64_t decode_counter_prev = 0;
......@@ -379,8 +379,10 @@ static void update_counter(volatile counter_stat_t * c, int64_t v) {
static void trace_handler(struct timespec initial, TRXEcpriState * s) {
struct timespec next;
int ready = 1;
ready &= tx_trace_ready;
ready &= rx_trace_ready;
if(s->trace_tx)
ready &= tx_trace_ready;
if(s->trace_rx)
ready &= rx_trace_ready;
if(ready) {
int64_t d;
FILE * f;
......@@ -823,7 +825,7 @@ static void *statistic_thread(void *p) {
next = initial;
for(int64_t i = 0;; i++) {
add_ns(&next, s->statistics_refresh_rate_ns);
if(s->trace_rx)
if(s->trace_rx || s->trace_tx)
trace_handler(initial, s);
print_stats(stats_file_desc, (i % 50) == 0);
#ifdef DEBUG
......@@ -1136,7 +1138,7 @@ static void trx_ecpri_write(TRXState *s1, trx_timestamp_t timestamp, const void
int len = nc * trxr_rbuf[0].len * sizeof(Complex);
if(__samples)
for(int i = 0; i < s->tx_n_channel; i++) {
uint8_t * src = ((uint8_t*) _samples[i]) + len;
uint8_t * src = ((uint8_t*) _samples[i]) + (nk * trxr_rbuf[0].len * sizeof(Complex));
uint8_t * dst = ((uint8_t *) trxw_rbuf[i].buffer) + trxw_rbuf[0].write_index * trxw_rbuf[0].len * sizeof(Complex);
memcpy(dst, src, len);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment