From 1f4f0c406c85595c748227336acd34a4f5df1428 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Fri, 28 Sep 2018 16:14:33 +0200 Subject: [PATCH] TSCH: fix timing variables in CCA code --- os/net/mac/tsch/tsch-slot-operation.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/net/mac/tsch/tsch-slot-operation.c b/os/net/mac/tsch/tsch-slot-operation.c index 74ab6b46e..2f36b9cfa 100644 --- a/os/net/mac/tsch/tsch-slot-operation.c +++ b/os/net/mac/tsch/tsch-slot-operation.c @@ -510,12 +510,12 @@ PT_THREAD(tsch_tx_slot(struct pt *pt, struct rtimer *t)) #if TSCH_CCA_ENABLED cca_status = 1; /* delay before CCA */ - TSCH_SCHEDULE_AND_YIELD(pt, t, current_slot_start, TS_CCA_OFFSET, "cca"); + TSCH_SCHEDULE_AND_YIELD(pt, t, current_slot_start, tsch_timing[tsch_ts_cca_offset], "cca"); TSCH_DEBUG_TX_EVENT(); tsch_radio_on(TSCH_RADIO_CMD_ON_WITHIN_TIMESLOT); /* CCA */ BUSYWAIT_UNTIL_ABS(!(cca_status |= NETSTACK_RADIO.channel_clear()), - current_slot_start, TS_CCA_OFFSET + TS_CCA); + current_slot_start, tsch_timing[tsch_ts_cca_offset] + tsch_timing[tsch_ts_cca]); TSCH_DEBUG_TX_EVENT(); /* there is not enough time to turn radio off */ /* NETSTACK_RADIO.off(); */